-->
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: BorrowedConnectionProvider acts queerly
PostPosted: Thu Nov 06, 2008 3:42 am 
Newbie

Joined: Wed May 31, 2006 3:58 am
Posts: 1
For me it seems that BorrowedConnectionProvider acts strangely. Method invoke rises exception if connection is not usable and invoking method is not "Close". but I had situation when two Session(?) had same conenction and on realease they both tryed to close this.

The problem is, before release there was invoke for method isClosed(). So if close is allowed without exception, then I think isClosed must be allowed also.

i think it would be much more reliable if line 41 would be

if ( !useable && !"isClosed".equals( method.getName() ) ) {
throw new HibernateException( "connnection proxy not usable after transaction completion" );
}

One typo is also there ("3 n-s in exception")")


Hibernate version: 3.2.6

Full stack trace of any exception that occurs:

org.hibernate.HibernateException: connnection proxy not usable after transaction completion
at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:42)
at $Proxy118.isClosed(Unknown Source)
at org.hibernate.jdbc.ConnectionManager.isAutoCommit(ConnectionManager.java:189)
at org.hibernate.jdbc.ConnectionManager.isAggressiveReleaseNoTransactionCheck(ConnectionManager.java:243)
at org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:295)
at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:225)
at org.hibernate.transaction.CacheSynchronization.afterCompletion(CacheSynchronization.java:85)
at weblogic.transaction.internal.ServerSCInfo.doAfterCompletion(ServerSCInfo.java:985)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 25, 2009 6:34 am 
Newbie

Joined: Wed Mar 25, 2009 5:02 am
Posts: 3
I just bumped into the same problem and I agree to the solution.
Should I open an issue on Jira?


Top
 Profile  
 
 Post subject: Re: BorrowedConnectionProvider acts queerly
PostPosted: Thu Aug 20, 2009 1:39 pm 
Newbie

Joined: Thu Aug 20, 2009 1:36 pm
Posts: 1
was this ever fixed?


Top
 Profile  
 
 Post subject: Re: BorrowedConnectionProvider acts queerly
PostPosted: Thu Aug 20, 2009 2:07 pm 
Newbie

Joined: Wed Mar 25, 2009 5:02 am
Posts: 3
http://opensource.atlassian.com/project ... e/HHH-1744
Doesn't seem so


Top
 Profile  
 
 Post subject: Re: BorrowedConnectionProvider acts queerly
PostPosted: Fri Aug 06, 2010 3:57 pm 
Newbie

Joined: Thu Oct 18, 2007 3:13 pm
Posts: 1
We are currently trying to upgrade our Weblogic 11g application from Hibernate 2.x to Hibernate 3.5.3 and have run into this problem. I take it that since the linked defect above has not been resolved that there must be a work around or some other type of resolution. Note that this occurs in our application after several hibernate queries have been executed through the hibernate framework we wrote around it. The framework we wrote closes the connection after each query. I read on a Spring related message board that Spring had a similar problem with "closing connections too aggressively". Is that what we could be doing? Maybe we need to change our application to not close a connection and reuse it within the same transaction?

Any help or suggestions would be GREATLY appreciated!


Top
 Profile  
 
 Post subject: Re: BorrowedConnectionProvider acts queerly
PostPosted: Fri Aug 06, 2010 5:44 pm 
Newbie

Joined: Wed Mar 25, 2009 5:02 am
Posts: 3
If I remember correctly, I used load time weaving and applied an aspect on this class, intercepting calls to the close()/isClosed() methods, setting a boolean to true on close() and returning it on isClosed(). Spring was happy after that.

I hope it helps.


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