Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection
In directory sc8-pr-cvs1:/tmp/cvs-serv30115/sf/hibernate/connection
Modified Files:
C3P0ConnectionProvider.java ConnectionProviderFactory.java
DBCPConnectionProvider.java
DriverManagerConnectionProvider.java
Log Message:
fixed bug in TimestampType
now possible to delete and re-save an object in same session
Index: C3P0ConnectionProvider.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/C3P0ConnectionProvider.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** C3P0ConnectionProvider.java 5 Jan 2003 02:11:20 -0000 1.3
--- C3P0ConnectionProvider.java 15 Jan 2003 10:33:16 -0000 1.4
***************
*** 60,64 ****
String jdbcDriverClass = props.getProperty(Environment.DRIVER);
String jdbcUrl = props.getProperty(Environment.URL);
! Properties connectionProps = ConnectionProviderFactory.getJdbcConnectionProperties(props);
log.info("C3P0 using driver: " + jdbcDriverClass + " at URL: " + jdbcUrl);
--- 60,64 ----
String jdbcDriverClass = props.getProperty(Environment.DRIVER);
String jdbcUrl = props.getProperty(Environment.URL);
! Properties connectionProps = ConnectionProviderFactory.getConnectionProperties(props);
log.info("C3P0 using driver: " + jdbcDriverClass + " at URL: " + jdbcUrl);
Index: ConnectionProviderFactory.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/ConnectionProviderFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ConnectionProviderFactory.java 12 Jan 2003 07:07:48 -0000 1.4
--- ConnectionProviderFactory.java 15 Jan 2003 10:33:16 -0000 1.5
***************
*** 5,8 ****
--- 5,9 ----
import java.util.Iterator;
import java.util.Properties;
+ import java.util.Set;
import org.apache.commons.logging.Log;
***************
*** 83,96 ****
* format accepted by <tt>DriverManager</tt> by triming the leading "<tt>hibernate.connection</tt>".
*/
! public static Properties getJdbcConnectionProperties(Properties properties) {
!
! HashSet specialProps = new HashSet();
! specialProps.add(Environment.DATASOURCE);
! specialProps.add(Environment.URL);
! specialProps.add(Environment.CONNECTION_PROVIDER);
! specialProps.add(Environment.POOL_SIZE);
! specialProps.add(Environment.ISOLATION);
! specialProps.add(Environment.DRIVER);
! specialProps.add(Environment.USER);
Iterator iter = properties.keySet().iterator();
--- 84,88 ----
* format accepted by <tt>DriverManager</tt> by triming the leading "<tt>hibernate.connection</tt>".
*/
! public static Properties getConnectionProperties(Properties properties) {
Iterator iter = properties.keySet().iterator();
***************
*** 98,102 ****
while ( iter.hasNext() ) {
String prop = (String) iter.next();
! if ( prop.indexOf(Environment.CONNECTION_PREFIX) > -1 && !specialProps.contains(prop) ) {
result.setProperty(
prop.substring( Environment.CONNECTION_PREFIX.length()+1 ),
--- 90,94 ----
while ( iter.hasNext() ) {
String prop = (String) iter.next();
! if ( prop.indexOf(Environment.CONNECTION_PREFIX) > -1 && !specialProperties.contains(prop) ) {
result.setProperty(
prop.substring( Environment.CONNECTION_PREFIX.length()+1 ),
***************
*** 108,111 ****
--- 100,116 ----
if (userName!=null) result.setProperty( "user", userName );
return result;
+ }
+
+ private static final Set specialProperties;
+ static {
+ specialProperties = new HashSet();
+ specialProperties.add(Environment.DATASOURCE);
+ specialProperties.add(Environment.URL);
+ specialProperties.add(Environment.CONNECTION_PROVIDER);
+ specialProperties.add(Environment.POOL_SIZE);
+ specialProperties.add(Environment.ISOLATION);
+ specialProperties.add(Environment.DRIVER);
+ specialProperties.add(Environment.USER);
+
}
Index: DBCPConnectionProvider.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/DBCPConnectionProvider.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DBCPConnectionProvider.java 5 Jan 2003 02:11:20 -0000 1.3
--- DBCPConnectionProvider.java 15 Jan 2003 10:33:17 -0000 1.4
***************
*** 65,69 ****
String jdbcDriverClass = props.getProperty(Environment.DRIVER);
String jdbcUrl = props.getProperty(Environment.URL);
! Properties connectionProps = ConnectionProviderFactory.getJdbcConnectionProperties(props);
log.info("DBCP using driver: " + jdbcDriverClass + " at URL: " + jdbcUrl);
--- 65,69 ----
String jdbcDriverClass = props.getProperty(Environment.DRIVER);
String jdbcUrl = props.getProperty(Environment.URL);
! Properties connectionProps = ConnectionProviderFactory.getConnectionProperties(props);
log.info("DBCP using driver: " + jdbcDriverClass + " at URL: " + jdbcUrl);
Index: DriverManagerConnectionProvider.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/DriverManagerConnectionProvider.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DriverManagerConnectionProvider.java 5 Jan 2003 02:11:20 -0000 1.4
--- DriverManagerConnectionProvider.java 15 Jan 2003 10:33:17 -0000 1.5
***************
*** 65,69 ****
}
! connectionProps = ConnectionProviderFactory.getJdbcConnectionProperties(props);
log.info( "using driver: " + driverClass + " at URL: " + url );
--- 65,69 ----
}
! connectionProps = ConnectionProviderFactory.getConnectionProperties(props);
log.info( "using driver: " + driverClass + " at URL: " + url );
|