PDA

View Full Version : JdbcTemplate don't see HibernateTemplate result in pooled datasource



Kowit_x
Jan 30th, 2006, 09:10 PM
My service class use HibernateTemplate and JdbcTemplate in the same transacion, it look like

public void doService(){
hibernateTemplate.update(...);
hibernateTemplate.flush();
JdbcTemplate.update(...) ; //do update base on hibernateTemplate
// update result

}

doService is configured as PROPAGATION_REQUIRED

everything work fine in org.springframework.jdbc.datasource.SingleConnecti onDataSource

but when I switch to org.apache.commons.dbcp.BasicDataSource I got problem here , it seem that jdbcTemplate don't see the affect by hibernateTemplate, it see recode like before hibernateTemplate do update

this situation like hibernateTemplate and JdbcTemplate do in defferent transaction ,since Oracle use mutiversion locking, the record still can read
when it is locked in exclusive mode

But I just wonder why it work fine in org.springframework.jdbc.datasource.SingleConnecti onDataSource but not org.apache.commons.dbcp.BasicDataSource

ps , my env is j2sdk1.4
Spring 1.2.5
Hibernate 3.1
Oracle 9i


Kowit Laison
regards.

twoencore
Jan 30th, 2006, 10:26 PM
u should post your context files, an actual code...i think u are having an issue i use to have.. putting the data access code in DAOs not directly in the service...Still wrap the service call in a transaction but, extend HibernateDAOSupport,etc. in the DAO classes only.

Costin Leau
Jan 31st, 2006, 07:41 AM
I have a project where both templates work on the same datasource without a problem. Make sure you inject the same datasource inside HB SessionFactory and JdbcTemplate. See the LocalSessionFactoryBean and the setUseTransactionAwareDataSource method. Also, try using c3p0 and see if it solves your problem. If you are still having issues post your jdbc, datasource and HB SF and TM configuration.

Kowit_x
Jan 31st, 2006, 10:58 PM
I setup another context to test my issue which still got the same problem



<beans>

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyP laceholderConfigurer">
<property name="locations">
<list>
<value>/WEB-INF/jdbc.properties</value>
<value>/WEB-INF/hibernate.properties</value>
</list>
</property>
</bean>

<bean id="localDataSource"
class="org.springframework.jdbc.datasource.SingleConnecti onDataSource" destroy-method="close">
<property name="driverClassName"><value>${localDs.driverClassName}</value></property>
<property name="url"><value>${localDs.url}</value></property>
<property name="username"><value>${localDs.username}</value></property>
<property name="password"><value>${localDs.password}</value></property>
<property name="suppressClose"><value>true</value></property>
</bean>

<bean id="dbcpDataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName"><value>${localDs.driverClassName}</value></property>
<property name="url"><value>${localDs.url}</value></property>
<property name="username"><value>${localDs.username}</value></property>
<property name="password"><value>${localDs.password}</value></property>

<property name="initialSize"><value>1</value></property>
<property name="maxActive"><value>0</value></property> <!-- zero for no limit. -->
<property name="maxIdle"><value>10</value></property>
<property name="validationQuery"><value>SELECT 1 FROM DUAL</value></property>
<property name="testOnBorrow"><value>true</value></property>
</bean>

<bean id="c3p0DataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass"><value>${localDs.driverClassName}</value></property>
<property name="jdbcUrl"><value>${localDs.url}</value></property>
<property name="user"><value>${localDs.username}</value></property>
<property name="password"><value>${localDs.password}</value></property>

</bean>

<bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwa reDataSourceProxy" destroy-method="close">
<property name="targetDataSource">
<ref bean ="dbcpDataSource"/>
</property>
</bean>


<!-- Hibernate SessionFactory Definition -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFac toryBean">
<property name="mappingResources">
<list>
<value>xxx/xxx/xxxx/model/Auction.hbm.xml</value>
</list>
</property>

<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">${hibernate.cglib.use_reflection_optimizer}</prop>
<!--<prop key="hibernate.cache.provider_class">net.sf.hibernate.cache.HashtableCacheProvider</prop>-->
</props>
</property>

<property name="dataSource">
<ref bean="dataSource"/>
</property>

</bean>


<!-- JDBC Template Defintion -->
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource"><ref local="dataSource"/></property>
</bean>

<!-- JDBC Template Defintion -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTempla te">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>


<!-- Transaction manager for a single JDBC DataSource -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransa ctionManager">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>

<bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean"
lazy-init="true" abstract="true">
<property name="transactionManager"><ref bean="transactionManager"/></property>
<property name="transactionAttributes">
<props>
<prop key="update*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>

<bean id="testService" parent="baseTransactionProxy">
<property name="target">
<bean class="test.spring.tx.MyService">
<property name="hibernateTemplate"><ref bean="hibernateTemplate"/></property>
<property name="jdbcTemplate"><ref bean="jdbcTemplate"/></property>
</bean>
</property>
</bean>


</beans>

====================== java code ================

public class MyService {

private JdbcTemplate jdbcTemplate;

private HibernateTemplate hibernateTemplate;

public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
this.hibernateTemplate = hibernateTemplate;
}

public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
public void updateTX(){

Auction auc = (Auction) hibernateTemplate.get(Auction.class,"2006010025");
auc.setEndTime(new Date());
SimpleDateFormat df = new SimpleDateFormat("hh:mm:ss",Locale.ENGLISH);
hibernateTemplate.update(auc);
hibernateTemplate.flush();
System.out.println(df.format(auc.getEndTime()));
System.out.println(df.format(jdbcTemplate.queryFor Object("select end_time from auction where auction_id = ? ",new String[]{"2006010025"},Timestamp.class)));

}
public static void main(String[] a){
ApplicationContext ctx = new FileSystemXmlApplicationContext("/WEB-INF/test-application-context.xml");
MyService sr = (MyService) ctx.getBean("testService");
sr.updateTX();
}

}

================== Result for run three time ============
11:44:55
11:44:02

11:49:36
11:44:55

11:50:19
11:49:36

code is simple , use hibernateTemplate for update date and use JdbcTemplate to read that value in the same transaction , jdbcTemplate alway see the value just before update.

But when I switch to use org.springframework.jdbc.datasource.SingleConnecti onDataSource , It print the expect result!

11:55:45
11:55:45

11:55:57
11:55:57

11:56:08
11:56:08

pls , use C3P0 still got the same isusue

Costin Leau
Feb 1st, 2006, 03:44 AM
You configuration is correct - however, you don't need to use TransactionAwareDataSource - HB sessionFactory will wrap the normal datasource into one automatically.
Just pass the actual datasource (c3p0 for example) to the sessionFactory and JDBCTemplate, and the sessionFactory inside the TransactionManager and you are set.

And btw, yourr test is correct and behaves as expected - when using a proper datasource, jdbcTemplate sees the values before the update since the transactions has not ended (even if you do the flush it depends on your transaction attributes (like READ_UNCOMMITED) if the information is read before the transaction is ended or not). Call the jdbcTemplate outside your update method (when the transaction has ended) and see what you get.
With SingleConnectionDataSource the same connection is used in both templates (i.e. the same HB session) so the information is available to both templates.

Kowit_x
Feb 1st, 2006, 08:21 AM
Thanks you for clearify, Costin .So this is my miss understanding .

I think if jdbc operations excute in the same transaction , it will like
do in sqlplus (u can see the value which not commit yet , in the same transaction ) , regardless if it in same connection or not .

So is it not possible for this situation ? , for example
if jdbcTemplate insert record that need to reference to the record which previously insert by hibernateTemplate in the same tx.

Costin Leau
Feb 1st, 2006, 08:53 AM
Hmm, I've looked at the jdbcTemplate code and it is aware of the thread-bound transaction - thus the same connection will be used by both templates. Inside the same connection both templates should see the same thing; turn on logging on Hibernate and see that it actually executes the flush to the database.

Kowit_x
Feb 1st, 2006, 08:05 PM
after set log4j configuaration to

log4j.logger.org.hibernate=DEBUG
log4j.logger.org.springframework.transaction=DEBUG
log4j.logger.org.springframework.jdbc.core.JdbcTem plate=DEBUG

This is partial logging

- <Updating entity: [com.sso2.eauction.model.Auction#2006010025]>
- <about to open PreparedStatement (open PreparedStatements: 0, globally: 0)>
- <update AUCTION set AUCTION_NAME=?, STATUS=?, EXTEND_TIME=?, START_TIME=?, END_TIME=?, UPD_BY=?, UPD_DATE=?, IS_REQUIRE_CA=?, CURRENCY_ID=?, AUCTION_TYPE=?, AUCTION_SUB_TYPE=?, OU_CODE=?, GROUP_ID=?, GROUP_TYPE=? where AUCTION_ID=?>
- <preparing statement>
- <Dehydrating entity: [com.sso2.eauction.model.Auction#2006010025]>
- <binding 'test_new1' to parameter: 1>
- <binding 'X' to parameter: 2>
- <binding '0000' to parameter: 3>
- <binding '10020-01-31 10:01:00' to parameter: 4>
- <binding '2549-02-02 08:54:44' to parameter: 5>
- <binding '0000000001' to parameter: 6>
- <binding '12866-02-01 11:26:52' to parameter: 7>
- <binding 'false' to parameter: 8>
- <binding '001' to parameter: 9>
- <binding 'RS' to parameter: 10>
- <binding 'M' to parameter: 11>
- <binding '003' to parameter: 12>
- <binding '000' to parameter: 13>
- <binding '000' to parameter: 14>
- <binding '2006010025' to parameter: 15>
- <Adding to batch>
- <Executing batch size: 1>
- <success of batch update unknown: 0>
- <about to close PreparedStatement (open PreparedStatements: 1, globally: 1)>
- <closing statement>
- <post flush>
08:54:44
- <Executing SQL query [select end_time from auction where auction_id = ? ]>
- <Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@1fc3c84] for key [org.apache.commons.dbcp.BasicDataSource@1071521] bound to thread [main]>
- <Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@1fc3c84] for key [org.apache.commons.dbcp.BasicDataSource@1071521] bound to thread [main]>
- <Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@1fc3c84] for key [org.apache.commons.dbcp.BasicDataSource@1071521] bound to thread [main]>
08:52:50
- <Invoking commit for transaction on test.spring.tx.MyService.updateTX>
- <commit>
- <automatically flushing session>
- <flushing session>
- <processing flush-time cascades>
- <dirty checking collections>
- <Flushing entities and processing referenced collections>
- <Processing unreferenced collections>
- <Scheduling collection removes/(re)creates/updates>
- <Flushed: 0 insertions, 0 updates, 0 deletions to 6 objects>
- <Flushed: 0 (re)creations, 0 updates, 0 removals to 7 collections>
- <executing flush>
- <post flush>
- <before transaction completion>
- <before transaction completion>
- <re-enabling autocommit>
- <committed JDBC Connection>
- <after transaction completion>
- <aggressively releasing JDBC connection>
- <closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]>
- <after transaction completion>
- <Clearing transaction synchronization>
- <Removed value [org.springframework.orm.hibernate3.SessionHolder@1 c486f2] for key [org.hibernate.impl.SessionFactoryImpl@1779885] from thread [main]>
- <Removed value [org.springframework.jdbc.datasource.ConnectionHold er@1fc3c84] for key [org.apache.commons.dbcp.BasicDataSource@1071521] from thread [main]>
- <opening user JDBC connection, application must close it>
- <closing session>
- <connection already null in cleanup : no action>

Costin Leau
Feb 2nd, 2006, 04:02 AM
The flush seems to happen accordingly and the same ConnectionHolder and the same commons.dbcp dataSource are used for both the jdbcTemplate and hibernateTemplate.
Try using c3p0 with logging on and see what happens. What database are you using?
Turn also logging on when using SingleDataSourceConnection.

Kowit_x
Feb 2nd, 2006, 09:04 PM
Log for C3P0


- <Updating entity: [com.sso2.eauction.model.Auction#2006010025]>
- <about to open PreparedStatement (open PreparedStatements: 0, globally: 0)>
- <update AUCTION set AUCTION_NAME=?, STATUS=?, EXTEND_TIME=?, START_TIME=?, END_TIME=?, UPD_BY=?, UPD_DATE=?, IS_REQUIRE_CA=?, JPP=?, CURRENCY_ID=?, AUCTION_TYPE=?, AUCTION_SUB_TYPE=?, OU_CODE=?, GROUP_ID=?, GROUP_TYPE=? where AUCTION_ID=?>
- <preparing statement>
- <Dehydrating entity: [com.sso2.eauction.model.Auction#2006010025]>
- <binding 'test_new1' to parameter: 1>
- <binding 'X' to parameter: 2>
- <binding '0000' to parameter: 3>
- <binding '10563-01-31 10:01:00' to parameter: 4>
- <binding '2549-02-03 09:35:26' to parameter: 5>
- <binding '0000000001' to parameter: 6>
- <binding '13409-02-01 11:26:52' to parameter: 7>
- <binding 'false' to parameter: 8>
- <binding null to parameter: 9>
- <binding '001' to parameter: 10>
- <binding 'RS' to parameter: 11>
- <binding 'M' to parameter: 12>
- <binding '003' to parameter: 13>
- <binding '000' to parameter: 14>
- <binding '000' to parameter: 15>
- <binding '2006010025' to parameter: 16>
- <Adding to batch>
- <Executing batch size: 1>
- <success of batch update unknown: 0>
- <about to close PreparedStatement (open PreparedStatements: 1, globally: 1)>
- <closing statement>
- <post flush>
09:35:26
- <Executing SQL query [select end_time from auction where auction_id = ? ]>
- <Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@1aacd5f] for key [com.mchange.v2.c3p0.ComboPooledDataSource@1bd7848[ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1bd7848, idleConnectionTestPeriod -> -1, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@192.168.10.206:1521:db920, loginTimeout -> 0, maxIdleTime -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ]] bound to thread [main]>
- <Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@1aacd5f] for key [com.mchange.v2.c3p0.ComboPooledDataSource@1bd7848[ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1bd7848, idleConnectionTestPeriod -> -1, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@192.168.10.206:1521:db920, loginTimeout -> 0, maxIdleTime -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ]] bound to thread [main]>
- <Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@1aacd5f] for key [com.mchange.v2.c3p0.ComboPooledDataSource@1bd7848[ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1bd7848, idleConnectionTestPeriod -> -1, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@192.168.10.206:1521:db920, loginTimeout -> 0, maxIdleTime -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ]] bound to thread [main]>
08:54:44
- <Invoking commit for transaction on test.spring.tx.MyService.updateTX>
- <Triggering beforeCommit synchronization>
- <Triggering beforeCompletion synchronization>
- <Initiating transaction commit>
- <Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@1283052]>
- <commit>
- <automatically flushing session>
- <flushing session>
- <processing flush-time cascades>
- <dirty checking collections>
- <Processing unreferenced collections>
- <Scheduling collection removes/(re)creates/updates>
- <Flushed: 0 insertions, 0 updates, 0 deletions to 6 objects>
- <Flushed: 0 (re)creations, 0 updates, 0 removals to 7 collections>
- <executing flush>
- <post flush>
- <before transaction completion>
- <before transaction completion>
- <re-enabling autocommit>
- <committed JDBC Connection>
- <after transaction completion>
- <aggressively releasing JDBC connection>
- <closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]>
- <after transaction completion>
- <Triggering afterCompletion synchronization>
- <Clearing transaction synchronization>
- <Removed value [org.springframework.orm.hibernate3.SessionHolder@1 9abd2b] for key [org.hibernate.impl.SessionFactoryImpl@1f98d58] from thread [main]>
- <Removed value [org.springframework.jdbc.datasource.ConnectionHold er@1aacd5f] for key [com.mchange.v2.c3p0.ComboPooledDataSource@1bd7848[ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1bd7848, idleConnectionTestPeriod -> -1, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@192.168.10.206:1521:db920, loginTimeout -> 0, maxIdleTime -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ]] from thread [main]>
- <opening user JDBC connection, application must close it>
- <Closing Hibernate Session [org.hibernate.impl.SessionImpl@1283052] after transaction>
- <closing session>
- <connection already null in cleanup : no action>


================================================== =======

Kowit_x
Feb 2nd, 2006, 09:05 PM
Log for SingleConnectionDataSource

- <Updating entity: [com.sso2.eauction.model.Auction#2006010025]>
- <about to open PreparedStatement (open PreparedStatements: 0, globally: 0)>
- <update AUCTION set AUCTION_NAME=?, STATUS=?, EXTEND_TIME=?, START_TIME=?, END_TIME=?, UPD_BY=?, UPD_DATE=?, IS_REQUIRE_CA=?, JPP=?, CURRENCY_ID=?, AUCTION_TYPE=?, AUCTION_SUB_TYPE=?, OU_CODE=?, GROUP_ID=?, GROUP_TYPE=? where AUCTION_ID=?>
- <preparing statement>
- <Dehydrating entity: [com.sso2.eauction.model.Auction#2006010025]>
- <binding 'test_new1' to parameter: 1>
- <binding 'X' to parameter: 2>
- <binding '0000' to parameter: 3>
- <binding '12192-01-31 10:01:00' to parameter: 4>
- <binding '2549-02-03 09:49:36' to parameter: 5>
- <binding '0000000001' to parameter: 6>
- <binding '15038-02-01 11:26:52' to parameter: 7>
- <binding 'false' to parameter: 8>
- <binding null to parameter: 9>
- <binding '001' to parameter: 10>
- <binding 'RS' to parameter: 11>
- <binding 'M' to parameter: 12>
- <binding '003' to parameter: 13>
- <binding '000' to parameter: 14>
- <binding '000' to parameter: 15>
- <binding '2006010025' to parameter: 16>
- <Adding to batch>
- <Executing batch size: 1>
- <success of batch update unknown: 0>
- <about to close PreparedStatement (open PreparedStatements: 1, globally: 1)>
- <closing statement>
- <post flush>
09:49:36
- <Executing SQL query [select end_time from auction where auction_id = ? ]>
- <Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@1b66b06] for key [org.springframework.jdbc.datasource.SingleConnecti onDataSource@15d252d] bound to thread [main]>
- <Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@1b66b06] for key [org.springframework.jdbc.datasource.SingleConnecti onDataSource@15d252d] bound to thread [main]>
- <Retrieved value [org.springframework.jdbc.datasource.ConnectionHold er@1b66b06] for key [org.springframework.jdbc.datasource.SingleConnecti onDataSource@15d252d] bound to thread [main]>
09:49:36
- <Invoking commit for transaction on test.spring.tx.MyService.updateTX>
- <Triggering beforeCommit synchronization>
- <Triggering beforeCompletion synchronization>
- <Initiating transaction commit>
- <Committing Hibernate transaction on Session [org.hibernate.impl.SessionImpl@1dc64a5]>
- <commit>
- <automatically flushing session>
- <flushing session>
- <processing flush-time cascades>
- <dirty checking collections>
- <Processing unreferenced collections>
- <Scheduling collection removes/(re)creates/updates>
- <Flushed: 0 insertions, 0 updates, 0 deletions to 6 objects>
- <Flushed: 0 (re)creations, 0 updates, 0 removals to 7 collections>
- <executing flush>
- <post flush>
- <before transaction completion>
- <before transaction completion>
- <re-enabling autocommit>
- <committed JDBC Connection>
- <after transaction completion>
- <aggressively releasing JDBC connection>
- <closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]>
- <after transaction completion>
- <Triggering afterCompletion synchronization>
- <Clearing transaction synchronization>
- <Removed value [org.springframework.orm.hibernate3.SessionHolder@9 f0d] for key [org.hibernate.impl.SessionFactoryImpl@ca3783] from thread [main]>
- <Removed value [org.springframework.jdbc.datasource.ConnectionHold er@1b66b06] for key [org.springframework.jdbc.datasource.SingleConnecti onDataSource@15d252d] from thread [main]>
- <opening user JDBC connection, application must close it>
- <Closing Hibernate Session [org.hibernate.impl.SessionImpl@1dc64a5] after transaction>
- <closing session>
- <connection already null in cleanup : no action>

=========================================

It seem there is no different ,

My Database is Oracle 9i

Costin Leau
Feb 3rd, 2006, 04:34 AM
According to the logs, the behaviour is exactly the same. even if you do a diff between the logs only the object instances differ.
I have no idea why the DataSources differ - there is a different somewhere but I can't spot it. Try using the devs mailing list or looking at the sources of SingleConnectionDataSource.