Author: jlmonteiro
Date: Wed May 12 12:52:08 2010
New Revision: 943472

URL: http://svn.apache.org/viewvc?rev=943472&view=rev
Log:
OPENEJB-1276: Add #getTransactionIdentifier(Transaction tx) to 
o.a.o.hibernate.TransactionManagerLookup
Excerpt from the Hibernate javadoc

Object getTransactionIdentifier(Transaction transaction)

    Determine an identifier for the given transaction appropriate for use in 
caching/lookup usages.

    Generally speaking the transaction itself will be returned here. This 
method was added specifically for use in WebSphere and other unfriendly JEE 
containers (although WebSphere is still the only known such brain-dead, 
sales-driven impl).

    Parameters:
        transaction - The transaction to be identified. 
    Returns:
        An appropropriate identifier


Modified:
    
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/MakeTxLookup.java

Modified: 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/MakeTxLookup.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/MakeTxLookup.java?rev=943472&r1=943471&r2=943472&view=diff
==============================================================================
--- 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/MakeTxLookup.java
 (original)
+++ 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/MakeTxLookup.java
 Wed May 12 12:52:08 2010
@@ -79,6 +79,14 @@ public class MakeTxLookup implements Opc
             mv.visitMaxs(1, 1);
             mv.visitEnd();
         }
+        {
+            mv = cw.visitMethod(ACC_PUBLIC, "getTransactionIdentifier", 
"(Ljavax/transaction/Transaction;)Ljava/lang/Object;", null, null);
+            mv.visitCode();
+            mv.visitVarInsn(ALOAD, 1);
+            mv.visitInsn(ARETURN);
+            mv.visitMaxs(1, 2);
+            mv.visitEnd();
+        }
         cw.visitEnd();
 
 


Reply via email to