|
From: <one...@us...> - 2002-12-27 11:54:51
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate
In directory sc8-pr-cvs1:/tmp/cvs-serv2878/cirrus/hibernate
Modified Files:
Query.java Environment.java
Log Message:
added validation settings to DBCP + C3P0 connection providers
added Query.setTimeout()
got tests working
Index: Query.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Query.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Query.java 24 Nov 2002 06:30:11 -0000 1.16
--- Query.java 27 Dec 2002 11:54:48 -0000 1.17
***************
*** 111,114 ****
--- 111,120 ----
/**
+ * Set a timeout for the underlying JDBC query.
+ * @param timeout the timeout in seconds
+ */
+ public void setTimeout(int timeout);
+
+ /**
* Bind a value to a JDBC-style query parameter.
* @param position the position of the parameter in the query
Index: Environment.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Environment.java,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** Environment.java 15 Dec 2002 05:12:40 -0000 1.79
--- Environment.java 27 Dec 2002 11:54:48 -0000 1.80
***************
*** 38,44 ****
public final class Environment {
!
private static final String VERSION = "1.2.1";
!
/**
* <tt>ConnectionProvider</tt> implementor to use when obtaining connections
--- 38,44 ----
public final class Environment {
!
private static final String VERSION = "1.2.1";
!
/**
* <tt>ConnectionProvider</tt> implementor to use when obtaining connections
***************
*** 77,86 ****
*/
public static final String CONNECTION_PREFIX = "hibernate.connection";
!
/**
* Maximum size for Hibernate's statement cache
*/
public static final String STATEMENT_CACHE_SIZE ="hibernate.statement_cache.size";
!
/**
* JNDI initial context class, <tt>Context.INITIAL_CONTEXT_FACTORY</tt>
--- 77,86 ----
*/
public static final String CONNECTION_PREFIX = "hibernate.connection";
!
/**
* Maximum size for Hibernate's statement cache
*/
public static final String STATEMENT_CACHE_SIZE ="hibernate.statement_cache.size";
!
/**
* JNDI initial context class, <tt>Context.INITIAL_CONTEXT_FACTORY</tt>
***************
*** 95,99 ****
*/
public static final String SESSION_FACTORY_NAME = "hibernate.session_factory_name";
!
/**
* Hibernate SQL <tt>Dialect</tt> class
--- 95,99 ----
*/
public static final String SESSION_FACTORY_NAME = "hibernate.session_factory_name";
!
/**
* Hibernate SQL <tt>Dialect</tt> class
***************
*** 104,108 ****
*/
public static final String DEFAULT_SCHEMA = "hibernate.default_schema";
!
/**
* Enable logging of generated SQL to the console
--- 104,108 ----
*/
public static final String DEFAULT_SCHEMA = "hibernate.default_schema";
!
/**
* Enable logging of generated SQL to the console
***************
*** 131,140 ****
*/
public static final String STATEMENT_BATCH_SIZE = "hibernate.jdbc.batch_size";
!
/**
* An XSLT resource used to generate "custom" XML
*/
public static final String OUTPUT_STYLESHEET ="hibernate.xml.output_stylesheet";
!
/**
* Maximum size of C3P0 connection pool
--- 131,140 ----
*/
public static final String STATEMENT_BATCH_SIZE = "hibernate.jdbc.batch_size";
!
/**
* An XSLT resource used to generate "custom" XML
*/
public static final String OUTPUT_STYLESHEET ="hibernate.xml.output_stylesheet";
!
/**
* Maximum size of C3P0 connection pool
***************
*** 152,157 ****
* Maximum size of C3P0 statement cache
*/
! public static final String C3P0_MAX_STATEMENTS = "hibernate.c3p0.max_statements";
!
/**
* Maximum number of checked out connections for DBCP connection pool
--- 152,161 ----
* Maximum size of C3P0 statement cache
*/
! public static final String C3P0_MAX_STATEMENTS = "hibernate.c3p0.max_statements";
! /**
! * Should we validate the connection on checkout? (optional)
! */
! public static final String C3P0_VALIDATE_CONNECTION = "hibernate.c3p0.validate";
!
/**
* Maximum number of checked out connections for DBCP connection pool
***************
*** 171,174 ****
--- 175,182 ----
public static final String DBCP_WHENEXHAUSTED = "hibernate.dbcp.whenExhaustedAction";
/**
+ * Query to execute for connection validation (optional)
+ */
+ public static final String DBCP_VALIDATION_QUERY = "hibernate.dbcp.validationQuery";
+ /**
* Maximum number of checked out statements for DBCP
*/
***************
*** 199,203 ****
*/
public static final String USER_TRANSACTION = "jta.UserTransaction";
!
/**
* A comma-seperated list of token substitutions to use when translating a Hibernate
--- 207,211 ----
*/
public static final String USER_TRANSACTION = "jta.UserTransaction";
!
/**
* A comma-seperated list of token substitutions to use when translating a Hibernate
***************
*** 211,215 ****
//Obsolete properties:
!
private static final String OUTPUT_STYLESHEET_OLD ="hibernate.output_stylesheet";
private static final String CONNECTION_PROVIDER_OLD ="hibernate.connection_provider";
--- 219,223 ----
//Obsolete properties:
!
private static final String OUTPUT_STYLESHEET_OLD ="hibernate.output_stylesheet";
private static final String CONNECTION_PROVIDER_OLD ="hibernate.connection_provider";
***************
*** 239,245 ****
private static final HashMap isolationLevels = new HashMap();
private static final Map obsoleteProperties = new HashMap();
!
private static final Log log = LogFactory.getLog(Environment.class);
!
/**
* Issues warnings to the user when any obsolete property names are used.
--- 247,253 ----
private static final HashMap isolationLevels = new HashMap();
private static final Map obsoleteProperties = new HashMap();
!
private static final Log log = LogFactory.getLog(Environment.class);
!
/**
* Issues warnings to the user when any obsolete property names are used.
***************
*** 255,261 ****
static {
!
log.info("Hibernate " + VERSION);
!
isolationLevels.put( new Integer(Connection.TRANSACTION_NONE), "NONE" );
isolationLevels.put( new Integer(Connection.TRANSACTION_READ_UNCOMMITTED), "READ_UNCOMMITTED" );
--- 263,269 ----
static {
!
log.info("Hibernate " + VERSION);
!
isolationLevels.put( new Integer(Connection.TRANSACTION_NONE), "NONE" );
isolationLevels.put( new Integer(Connection.TRANSACTION_READ_UNCOMMITTED), "READ_UNCOMMITTED" );
***************
*** 263,267 ****
isolationLevels.put( new Integer(Connection.TRANSACTION_REPEATABLE_READ), "REPEATABLE_READ" );
isolationLevels.put( new Integer(Connection.TRANSACTION_SERIALIZABLE), "SERIALIZABLE" );
!
obsoleteProperties.put(CONNECTION_PROVIDER_OLD, CONNECTION_PROVIDER);
obsoleteProperties.put(DRIVER_OLD, DRIVER);
--- 271,275 ----
isolationLevels.put( new Integer(Connection.TRANSACTION_REPEATABLE_READ), "REPEATABLE_READ" );
isolationLevels.put( new Integer(Connection.TRANSACTION_SERIALIZABLE), "SERIALIZABLE" );
!
obsoleteProperties.put(CONNECTION_PROVIDER_OLD, CONNECTION_PROVIDER);
obsoleteProperties.put(DRIVER_OLD, DRIVER);
***************
*** 295,301 ****
}
}
!
properties.putAll( System.getProperties() );
!
verifyProperties(properties);
--- 303,309 ----
}
}
!
properties.putAll( System.getProperties() );
!
verifyProperties(properties);
***************
*** 314,318 ****
log.info("JVM proxy support: " + proxySupport);
jvmSupportsProxies = proxySupport;
!
boolean linkedHashSupport;
try {
--- 322,326 ----
log.info("JVM proxy support: " + proxySupport);
jvmSupportsProxies = proxySupport;
!
boolean linkedHashSupport;
try {
***************
*** 328,332 ****
/**
! * Does this JVM support dynamic proxies? (Now return true because CGLIB
* proxies work on all supported JDK)
*/
--- 336,340 ----
/**
! * Does this JVM support dynamic proxies? (Now return true because CGLIB
* proxies work on all supported JDK)
*/
***************
*** 334,338 ****
return true;//jvmSupportsProxies;
}
!
/**
* Does this JVM support <tt>LinkedHashSet</tt>, <tt>LinkedHashMap</tt>?
--- 342,346 ----
return true;//jvmSupportsProxies;
}
!
/**
* Does this JVM support <tt>LinkedHashSet</tt>, <tt>LinkedHashMap</tt>?
***************
*** 362,369 ****
return properties;
}
!
/**
* Get the name of a JDBC transaction isolation level
! *
* @see java.sql.Connection
* @param isolation as defined by <tt>java.sql.Connection</tt>
--- 370,377 ----
return properties;
}
!
/**
* Get the name of a JDBC transaction isolation level
! *
* @see java.sql.Connection
* @param isolation as defined by <tt>java.sql.Connection</tt>
|