From: Steve E. (JIRA) <no...@at...> - 2006-05-30 14:58:29
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1786?page=all ] Steve Ebersole updated HHH-1786: -------------------------------- type: Improvement (was: Bug) Ah great. More WebSphere transaction crappiness! ;) This is certainly not a Hibernate bug. What we do is completely correct from the JTA/JTS specification perspective. This is a problem in WebSphere because of their decision to not allow proper access to the JTA/JTS objects. As discussed many times before, they are technically allowed to not expose these objects if they so wish as the previous ad current J2EE specs have not required them to for compliance. Even if every other app server in the world does this, it is IBM's decision whether or not to expose the JTA/JTS objects or some proprietary/vendor-lockin replicas. Oh they'll argue that it is to "protect users from themselves", yet turn around and expose the same basic functionality, just through proprietary APIs ;) In fact, JEE 5 will in all likelihood begin requiring access to a new javax.transaction.TransactionSynchronizationRegistry interface which is being proposed as part of the JTA 1.1 spec. Of course we'll see how IBM circumvents that one in about 5 years when they are JEE 5 certified :)) I'll get around to looking at this when I get some time. Or you could of course let IBM know how you feel about this decision they have made. We'll see which comes to fruition first ;) In the meantime, just plugin your implementation as the context to use (hibernate.current_session_context_class). This is an extension point... > JTASessionContext.CleanupSynch does not remove sessions from currentSessionMap > ------------------------------------------------------------------------------ > > Key: HHH-1786 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1786 > Project: Hibernate3 > Type: Improvement > Versions: 3.1.2 > Environment: IBM WebSphere 6.0.2.7, Hibernate CVS snapshot from 2006-02-24 > Reporter: Tomi Szabo > Attachments: JTASessionContext.java > > > We are using JTASessionContext, CMTTransaction and WebSphereExtendedJTATransactionLookup. We have experienced some memmory leak problems and after closer inspection we have found that Hibernate sessions are not removed from currentSessionMap inside JTASessionContext. > Method JTASessionContext.CleanupSynch.afterCompletion() is called as expected but code "context.currentSessionMap.remove( txn );" does not remove session from Map because of key's hashcode has changed. This is due to fact that com.ibm.websphere.jtaextensions.ExtendedJTATransaction.hashCode is actually ID of underlaying transaction. But if it comes to the afterCompletion method in CleanupSynch the underlaying transaction is already closed. Closed transaction has ID 0 (default value) and it is different from ID under which the Hibernate session was previously inserted into Map. > Possible patch is in attachements. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |