-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Why Multi JDBC connection in a single transaction?
PostPosted: Tue Feb 19, 2008 6:59 pm 
Newbie

Joined: Tue Feb 19, 2008 4:44 pm
Posts: 1
During an hibernate transaction, I'm doing a get() and seeing, in the log, many "opening JDBC connection" and the number of PreparedStatement is never greater than 1. I only read tables, no update or insert.

The "hibernate.connection.release_mode" by default is set to after_statement and according to the hibernate doc, it's "highly discouraged" to use "on_close" and "JTA should not use after_transaction"!


Why the connection is close after some statement?
Why the preparedStatement are closed?

I would like hibernate reuse some preparedStatement. How the hibernate configuration should be set?

Hibernate version:3.2.6.ga
JDBC Driver Informix Dynamic Server version 2.21.JC3
JBoss 4.2.1ga

JTA Environment

2008-02-19 17:23:39,301 145580 DEBUG [org.hibernate.transaction.JTATransaction] (http-XXX:) begin
2008-02-19 17:23:39,302 145581 DEBUG [org.hibernate.transaction.JTATransaction] (http-XXX:) Began a new JTA transaction
2008-02-19 17:23:39,312 145591 DEBUG [org.hibernate.jdbc.JDBCContext] (http-XXX
:) successfully registered Synchronization
2008-02-19 17:23:39,407 145686 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-XXX:) about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2008-02-19 17:23:39,407 145686 DEBUG [org.hibernate.jdbc.ConnectionManager] (http-XXX:) opening JDBC connection
2008-02-19 17:23:39,408 145687 DEBUG [org.hibernate.SQL]
2008-02-19 17:23:39,445 145724 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-XXX:) about to open ResultSet (open ResultSets: 0, globally: 0)
2008-02-19 17:23:39,447 145726 DEBUG [org.hibernate.loader.Loader] (http-XXX:)
result row: EntityKey[com.aaa.dom.pkg.definition.PackageDefinition#SPTMA], EntityKey[com.aaa.dom.pkg.def
inition.DivisionCodeDefinition#SPT9 ], EntityKey[com.aaa.dom.pkg.Package#RSTSZGCCF20070221171958]
2008-02-19 17:23:39,457 145736 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-XXX:) about to close ResultSet (open ResultSets: 1, globally: 1)
2008-02-19 17:23:39,459 145738 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-XXX:) about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2008-02-19 17:23:39,459 145738 DEBUG [org.hibernate.jdbc.ConnectionManager] (http-XXX:) aggressively releasing JDBC connection
2008-02-19 17:23:39,460 145739 DEBUG [org.hibernate.jdbc.ConnectionManager] (http-XXX:) releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2008-02-19 17:23:39,460 145739 DEBUG [org.hibernate.engine.TwoPhaseLoad] (http-XXX:) resolving associations for [com.aaa.dom.pkg.definition.PackageDefinition#SPTMA]
2008-02-19 17:23:39,460 145739 DEBUG [org.hibernate.loader.Loader] (http-XXX:)
loading entity: [com.aaa.dom.pkg.definition.ConditionDefinition#DW200]
2008-02-19 17:23:39,460 145739 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-XXX:) about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2008-02-19 17:23:39,461 145740 DEBUG [org.hibernate.jdbc.ConnectionManager] (http-XXX:) opening JDBC connection
2008-02-19 17:23:39,461 145740 DEBUG [org.hibernate.SQL]
2008-02-19 17:23:39,467 145746 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-XXX:) about to open ResultSet (open ResultSets: 0, globally: 0)
2008-02-19 17:23:39,468 145747 DEBUG [org.hibernate.loader.Loader] (http-XXX:)
result row: EntityKey[com.aaa.dom.pkg.definition.ConditionDefinition#DW200]
2008-02-19 17:23:39,469 145748 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-XXX:) about to close ResultSet (open ResultSets: 1, globally: 1)
2008-02-19 17:23:39,470 145749 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-XXX:) about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2008-02-19 17:23:39,470 145749 DEBUG [org.hibernate.jdbc.ConnectionManager] (http-XXX:) aggressively releasing JDBC connection
2008-02-19 17:23:39,471 145750 DEBUG [org.hibernate.jdbc.ConnectionManager] (http-XXX:) releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2008-02-19 17:23:39,471 145750 DEBUG [org.hibernate.engine.TwoPhaseLoad] (http-XXX:) resolving associations for [com.aaa.dom.pkg.definition.ConditionDefinition#DW200]
2008-02-19 17:23:39,471 145750 DEBUG [org.hibernate.engine.TwoPhaseLoad] (http-XXX:) done materializing entity [com.aaa.dom.pkg.definition.ConditionDefinition#DW200]
2008-02-19 17:23:39,472 145751 DEBUG [org.hibernate.loader.Loader] (http-XXX:)
done entity load
2008-02-19 17:23:39,472 145751 DEBUG [org.hibernate.loader.Loader] (http-XXX:)
loading entity: [com.aaa.dom.pkg.definition.DivisionCodeDefinition#SPT9 ]
2008-02-19 17:23:39,472 145751 DEBUG [org.hibernate.jdbc.AbstractBatcher] (http-XXX:) about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2008-02-19 17:23:39,472 145751 DEBUG [org.hibernate.jdbc.ConnectionManager] (http-XXX:) opening JDBC connection
...
2008-02-19 17:23:40,271 146550 DEBUG [org.hibernate.transaction.JTATransaction] (http-XXX:) commit
2008-02-19 17:23:40,273 146552 DEBUG [org.hibernate.transaction.JTATransaction] (http-XXX:) Committed JTA UserTransaction



<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.datasource">java:jdbc/aaa/amp</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLooku
p</property>
<property name="hibernate.dialect">org.hibernate.dialect.InformixDialect</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.cache.provider_class">com.aaa.infra.hibernate.EhCacheProvider</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cache.use_structured_entries">false</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.