Author: manik.surtani(a)jboss.com
Date: 2008-05-14 07:49:11 -0400 (Wed, 14 May 2008)
New Revision: 5842
Modified:
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
core/trunk/src/test/java/org/jboss/cache/transaction/DeadlockTest.java
Log:
Updated broken tests
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-05-14
11:48:46 UTC (rev 5841)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-05-14
11:49:11 UTC (rev 5842)
@@ -323,15 +323,20 @@
*/
public void undoOperations()
{
- if (trace)
+ if (modificationList == null)
{
- log.trace("undoOperations " + modificationList);
+ if (trace) log.trace("Modification list is null, no modifications in this
transaction!");
+ return;
}
+
+ if (trace) log.trace("undoOperations " + modificationList);
+
ArrayList<ReversibleCommand> copy;
- synchronized (modificationList)
- {
- copy = new ArrayList<ReversibleCommand>(modificationList);
- }
+// synchronized (modificationList)
+// {
+ // no need to sync? Only one thread would access a transaction at any given time?
+ copy = new ArrayList<ReversibleCommand>(modificationList);
+// }
for (ListIterator i = copy.listIterator(copy.size()); i.hasPrevious();)
{
Object undoOp = i.previous();
Modified: core/trunk/src/test/java/org/jboss/cache/transaction/DeadlockTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/DeadlockTest.java 2008-05-14
11:48:46 UTC (rev 5841)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/DeadlockTest.java 2008-05-14
11:49:11 UTC (rev 5842)
@@ -30,8 +30,7 @@
import javax.transaction.TransactionManager;
/**
- * Tests transactional access to a local CacheImpl, with concurrent (deadlock-prone)
access.
- * Note: we use DummpyTranasctionManager to replace jta
+ * Tests transactional access to a local Cache, with concurrent (deadlock-prone) access.
*
* @version $Id$
*/
Show replies by date