From eb2e83348b06b3636b9fde0aac306e24e935c01c Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Tue, 27 May 2008 14:48:51 +0000 Subject: [PATCH] HHH-1786 : current session cleanup synch hack for WebSphere. git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14691 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../main/java/org/hibernate/context/JTASessionContext.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/hibernate/context/JTASessionContext.java b/core/src/main/java/org/hibernate/context/JTASessionContext.java index d331a73d1f..b7490a856a 100644 --- a/core/src/main/java/org/hibernate/context/JTASessionContext.java +++ b/core/src/main/java/org/hibernate/context/JTASessionContext.java @@ -118,7 +118,10 @@ public class JTASessionContext implements CurrentSessionContext { throw new HibernateException( "Unable to register cleanup Synchronization with TransactionManager" ); } - currentSessionMap.put( txn, currentSession ); + Object txnIdentifier = factory.getSettings().getTransactionManagerLookup() == null + ? txn + : factory.getSettings().getTransactionManagerLookup().getTransactionIdentifier( txn ); + currentSessionMap.put( txnIdentifier, currentSession ); } return currentSession;