User: osh
Date: 00/10/08 01:32:54
Modified: src/main/org/jboss/ejb/plugins
EntityInstanceInterceptor.java
Log:
Avoid NullPointerException due to a race where the transaction is
terminated after checking for an active transaction but before
printing the transaction id to the log.
Revision Changes Path
1.15 +4 -2
jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java
Index: EntityInstanceInterceptor.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- EntityInstanceInterceptor.java 2000/10/03 02:34:54 1.14
+++ EntityInstanceInterceptor.java 2000/10/08 08:32:53 1.15
@@ -43,7 +43,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.14 $
+* @version $Revision: 1.15 $
*/
public class EntityInstanceInterceptor
extends AbstractInterceptor
@@ -133,7 +133,9 @@
synchronized (ctx)
{
// Possible deadlock
- Logger.log("LOCKING-WAITING for id "+ctx.getId()+" ctx.hash
"+ctx.hashCode()+" tx.hash "+ctx.getTransaction().hashCode());
+ Transaction tx = ctx.getTransaction();
+
+ Logger.log("LOCKING-WAITING for id "+ctx.getId()+" ctx.hash
"+ctx.hashCode()+" tx:"+((tx == null) ? "null" : tx.toString()));
try{ctx.wait(5000);}
catch (InterruptedException ie) {}