-->
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.  [ 6 posts ] 
Author Message
 Post subject: Connection.close() requested while a transaction is in progr
PostPosted: Mon Oct 16, 2006 11:22 am 
Beginner
Beginner

Joined: Sat Jan 14, 2006 10:05 am
Posts: 22
Location: spb.ru
Hello, fiends

Hibernate version: 3
Mapping documents: too large
Code between sessionFactory.openSession() and session.close():
Hibernate Tools 3.2 beta8
Full stack trace of any exception that occurs:
!SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-10-16 19:03:54.065
!MESSAGE com.ibm.db2.jcc.b.SqlException: java.sql.Connection.close() requested while a transaction is in progress on the connection.The transaction remains active, and the connection cannot be closed.
!STACK 0
com.ibm.db2.jcc.b.SqlException: java.sql.Connection.close() requested while a transaction is in progress on the connection.The transaction remains active, and the connection cannot be closed.
at com.ibm.db2.jcc.b.p.r(p.java:1405)
....
at com.ibm.db2.jcc.b.p.close(p.java:1398)
at org.hibernate.connection.DriverManagerConnectionProvider.closeConnection(DriverManagerConnectionProvider.java:137)
at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:445)
at org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:400)
at org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:287)
at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:241)
at org.hibernate.impl.SessionImpl.afterOperation(SessionImpl.java:417)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1126)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:48)
at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:105)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:927)
at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1279)
Name and version of the database you are using:
DB2 8
The generated SQL (show_sql=true):
any HSQL query.

what You think about this. I'm download hibTools b8 to play whith it. But I can't execute any HSQL query. Whats wrong? May be in DB2 or its driver.

hibernate.cfg.xml

<hibernate-configuration>
<session-factory name="ide">
<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.url">jdbc:db2://xxxx:xxxx/xxxxx</property>
<property name="hibernate.connection.username">xxxxx</property>
<property name="hibernate.default_schema">xxxxxx</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>

<property name="hibernate.cache.use_query_cache">false</property>
<property name="hibernate.cache.use_second_level_cache">false</property>

<property name="hibernate.connection.pool_size">0</property>
<property name="hibernate.current_session_context_class">thread</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>

i try remove and change hibernate.connection.pool_size and hibernate.current_session_context_class parameters - have no means.

What I sould to do? thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 16, 2006 11:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
try and run without agressive connection releasing.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 17, 2006 3:45 am 
Beginner
Beginner

Joined: Sat Jan 14, 2006 10:05 am
Posts: 22
Location: spb.ru
Thanks !!!

here is final config, may be usefull

<hibernate-configuration>
<session-factory name="ide">
<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.connection.password">xxx</property>
<property name="hibernate.connection.url">jdbc:db2://xxx:xxx/xxxx</property>
<property name="hibernate.connection.username">xxx</property>
<property name="hibernate.default_schema">xxxx</property>
<property name="hibernate.dialect">org.hibernate.dialect.DB2Dialect</property>

<property name="hibernate.cache.use_query_cache">false</property>
<property name="hibernate.cache.use_second_level_cache">false</property>

<property name="hibernate.connection.aggressive_release">false</property>

<property name="hibernate.connection.release_mode">after_transaction</property>
<property name="hibernate.connection.autocommit">true</property>
<property name="hibernate.connection.pool_size">0</property>
<property name="hibernate.current_session_context_class">thread</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>

But, threre are some DB2 specific issues. I will post it later
max, thanks again


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 17, 2006 3:54 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
could you report an improvement request in jira to have an option to automatically set (or warn against) these settings.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 17, 2006 5:18 am 
Beginner
Beginner

Joined: Sat Jan 14, 2006 10:05 am
Posts: 22
Location: spb.ru
to all,

REMOVE DEFAULT SCHEMA for DB2 !!! with this parameter present "Database" node in config tree is empty !!!

to max

I try to remove unecessary paramemeters, i post to jira after this.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 17, 2006 5:25 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the default schema is properly case sensitive.

_________________
Max
Don't forget to rate


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.