[JBoss-dev] CVS update: jboss/src/main/org/jboss/tm TxCapsule.java
User: d_jencks Date: 02/03/24 13:44:32 Modified:src/main/org/jboss/tm TxCapsule.java Log: New ConnectionManager implementation Revision ChangesPath 1.34 +71 -28jboss/src/main/org/jboss/tm/TxCapsule.java Index: TxCapsule.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TxCapsule.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- TxCapsule.java16 Feb 2002 22:38:51 - 1.33 +++ TxCapsule.java24 Mar 2002 21:44:32 - 1.34 @@ -49,7 +49,7 @@ * @author mailto:[EMAIL PROTECTED]";>Ole Husgaard * @author mailto:[EMAIL PROTECTED]";>Toby Allsopp * @author mailto:[EMAIL PROTECTED]";>Jason Dillon - * @version $Revision: 1.33 $ + * @version $Revision: 1.34 $ */ class TxCapsule implements TimeoutTarget @@ -68,7 +68,7 @@ private Logger log = Logger.getLogger(this.getClass()); /** True if trace messages should be logged. */ - private boolean trace = log.isDebugEnabled(); + private boolean trace = log.isTraceEnabled(); // Static @@ -177,7 +177,10 @@ start = System.currentTimeMillis(); this.timeout = TimeoutFactory.createTimeout(start+timeout, this); - + + //check to see if log settings have changed + trace = log.isTraceEnabled(); + if (trace) { log.trace("Reused instance for tx=" + toString()); @@ -342,7 +345,9 @@ log.trace("Zero phase commit: No resources."); } status = Status.STATUS_COMMITTED; -} else if (resourceCount == 1) + //} else if (resourceCount == 1) +} +else if (isOneResource()) { // One phase commit if (trace) @@ -823,6 +828,8 @@ /** * Count of resources that have participated in this transaction. +* This contains a count of all XAResources, not a count of distinct resource managers. +* It is the length of resources and other such arrays. */ private int resourceCount = 0; @@ -1170,7 +1177,7 @@ { if (trace) { - log.trace("unhandled throwable", t); + log.trace("unhandled throwable error in startResource", t); } status = Status.STATUS_MARKED_ROLLBACK; return; @@ -1224,7 +1231,7 @@ { if (trace) { - log.trace("unhandled throwable", t); + log.trace("unhandled throwable error in endResource", t); } status = Status.STATUS_MARKED_ROLLBACK; // Resource may or may not be ended after illegal exception. @@ -1240,7 +1247,10 @@ else { if (flag == XAResource.TMFAIL) +{ + status = Status.STATUS_MARKED_ROLLBACK; +} resourceState[idx] = RS_ENDED; } } finally @@ -1314,6 +1324,10 @@ { try { + if (trace) + { + log.trace("calling sync " + i + ", " + sync[i]); + } // end of if () sync[i].beforeCompletion(); } catch (Throwable t) { @@ -1478,31 +1492,35 @@ // Set done flag so we get no more frontends waiting for // the lock. done = true; + // Clear content of collections. + for (int i = 0; i < syncCount; ++i) + { +sync[i] = null; // release for GC + } + syncCount = 0; + + //for (int i = 0; i < transactionCount; ++i) + // transactions[i] = null; // release for GC + //transactionCount = 0; + transaction = null; // release for GC + + for (int i = 0; i < resourceCount; ++i) + { +resources[i] = null; // release for GC +resourceXids[i] = null; // release for GC + } + resourceCount = 0; + // If using a special class, second constructor argument is now useless. + if (xidConstructor != null) + { +xidConstructorArgs[1] = null; // This now needs initializing + } // Wake up anybody waiting for the lock. notifyAll(); } - // Clear content of collections. - for (int i = 0; i < syncCount; ++i) - sync[i] = null; // release for GC - syncCount = 0; - //for (int i = 0; i < transactionCount; ++i) - // transactions[i] = null; // release
[JBoss-dev] CVS update: jboss/src/main/org/jboss/tm TxCapsule.java TxManager.java
User: ejort Date: 02/01/12 13:14:29 Modified:src/main/org/jboss/tm TxCapsule.java TxManager.java Log: Remove directory reference to log4j Category in preparation for log4j 1.2 Revision ChangesPath 1.32 +3 -3 jboss/src/main/org/jboss/tm/TxCapsule.java Index: TxCapsule.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TxCapsule.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- TxCapsule.java2002/01/05 12:08:54 1.31 +++ TxCapsule.java2002/01/12 21:14:29 1.32 @@ -30,7 +30,7 @@ import javax.transaction.xa.XAResource; import javax.transaction.xa.XAException; -import org.apache.log4j.Category; +import org.jboss.logging.Logger; import org.jboss.util.timeout.Timeout; import org.jboss.util.timeout.TimeoutTarget; @@ -49,7 +49,7 @@ * @author mailto:[EMAIL PROTECTED]";>Ole Husgaard * @author mailto:[EMAIL PROTECTED]";>Toby Allsopp * @author mailto:[EMAIL PROTECTED]";>Jason Dillon - * @version $Revision: 1.31 $ + * @version $Revision: 1.32 $ */ class TxCapsule implements TimeoutTarget @@ -65,7 +65,7 @@ // Attributes /** Instance logger. */ - private Category log = Category.getInstance(this.getClass()); + private Logger log = Logger.getLogger(this.getClass()); /** True if debug messages should be logged. */ private boolean debug = log.isDebugEnabled(); 1.34 +3 -3 jboss/src/main/org/jboss/tm/TxManager.java Index: TxManager.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TxManager.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- TxManager.java2001/09/26 21:01:24 1.33 +++ TxManager.java2002/01/12 21:14:29 1.34 @@ -26,7 +26,7 @@ import javax.transaction.xa.XAResource; import javax.transaction.xa.XAException; -import org.apache.log4j.Category; +import org.jboss.logging.Logger; /** * Our TransactionManager implementation. @@ -35,7 +35,7 @@ * @author mailto:[EMAIL PROTECTED]";>Marc Fleury * @author mailto:[EMAIL PROTECTED]";>Ole Husgaard * @author mailto:[EMAIL PROTECTED]";>Jason Dillon - * @version $Revision: 1.33 $ + * @version $Revision: 1.34 $ */ public class TxManager implements TransactionManager, @@ -47,7 +47,7 @@ // Attributes /** Instance logger. */ - private Category log = Category.getInstance(this.getClass()); + private Logger log = Logger.getLogger(this.getClass()); /** True if debug messages should be logged. */ private boolean debug = log.isDebugEnabled(); ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/tm TxCapsule.java
User: ejort Date: 02/01/05 04:08:54 Modified:src/main/org/jboss/tm TxCapsule.java Log: Guarded debug logging Revision ChangesPath 1.31 +4 -3 jboss/src/main/org/jboss/tm/TxCapsule.java Index: TxCapsule.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TxCapsule.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- TxCapsule.java2001/08/11 02:38:33 1.30 +++ TxCapsule.java2002/01/05 12:08:54 1.31 @@ -49,7 +49,7 @@ * @author mailto:[EMAIL PROTECTED]";>Ole Husgaard * @author mailto:[EMAIL PROTECTED]";>Toby Allsopp * @author mailto:[EMAIL PROTECTED]";>Jason Dillon - * @version $Revision: 1.30 $ + * @version $Revision: 1.31 $ */ class TxCapsule implements TimeoutTarget @@ -69,7 +69,7 @@ /** True if debug messages should be logged. */ private boolean debug = log.isDebugEnabled(); - + // Static /** @@ -987,7 +987,8 @@ try { timeout.cancel(); } catch (Exception e) { -log.debug("failed to cancel timeout", e); +if (debug) + log.debug("failed to cancel timeout", e); } finally { lock(); } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/tm TxCapsule.java
User: danch Date: 01/04/16 18:29:06 Modified:src/main/org/jboss/tm TxCapsule.java Log: prevent race condition and lock contention Revision ChangesPath 1.25 +9 -4 jboss/src/main/org/jboss/tm/TxCapsule.java Index: TxCapsule.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TxCapsule.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- TxCapsule.java2001/02/09 18:56:17 1.24 +++ TxCapsule.java2001/04/17 01:29:06 1.25 @@ -48,7 +48,7 @@ * @author mailto:[EMAIL PROTECTED]">Marc Fleury * @author mailto:[EMAIL PROTECTED]">Ole Husgaard * - * @version $Revision: 1.24 $ + * @version $Revision: 1.25 $ */ class TxCapsule implements TimeoutTarget { @@ -380,6 +380,10 @@ } finally { unlock(); + +// This instance is now ready for reuse (when we release the lock). +if (done) + releaseInstance(this); } } @@ -425,6 +429,10 @@ } } finally { unlock(); + +// This instance is now ready for reuse (when we release the lock). +if (done) + releaseInstance(this); } } @@ -1383,9 +1391,6 @@ // If using a special class, second constructor argument is now useless. if (xidConstructor != null) xidConstructorArgs[1] = null; // This now needs initializing - - // This instance is now ready for reuse (when we release the lock). - releaseInstance(this); } /** ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/tm TxCapsule.java
User: danch Date: 01/04/16 18:28:41 Modified:src/main/org/jboss/tm Tag: Branch_2_2 TxCapsule.java Log: prevent race condition and lock contention Revision ChangesPath No revision No revision 1.24.2.1 +9 -4 jboss/src/main/org/jboss/tm/TxCapsule.java Index: TxCapsule.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TxCapsule.java,v retrieving revision 1.24 retrieving revision 1.24.2.1 diff -u -r1.24 -r1.24.2.1 --- TxCapsule.java2001/02/09 18:56:17 1.24 +++ TxCapsule.java2001/04/17 01:28:41 1.24.2.1 @@ -48,7 +48,7 @@ * @author mailto:[EMAIL PROTECTED]">Marc Fleury * @author mailto:[EMAIL PROTECTED]">Ole Husgaard * - * @version $Revision: 1.24 $ + * @version $Revision: 1.24.2.1 $ */ class TxCapsule implements TimeoutTarget { @@ -380,6 +380,10 @@ } finally { unlock(); + +// This instance is now ready for reuse (when we release the lock). +if (done) + releaseInstance(this); } } @@ -425,6 +429,10 @@ } } finally { unlock(); + +// This instance is now ready for reuse (when we release the lock). +if (done) + releaseInstance(this); } } @@ -1383,9 +1391,6 @@ // If using a special class, second constructor argument is now useless. if (xidConstructor != null) xidConstructorArgs[1] = null; // This now needs initializing - - // This instance is now ready for reuse (when we release the lock). - releaseInstance(this); } /** ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development