Author: mircea.markus
Date: 2008-06-12 07:53:27 -0400 (Thu, 12 Jun 2008)
New Revision: 5977
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
core/trunk/src/test/java/org/jboss/cache/commands/read/GravitateDataCommandTest.java
Log:
http://jira.jboss.com/jira/browse/JBCACHE-1363 - rollback: runtime excpetion propagation
to the user was rolledback, as it needs ample changes, and not sure if I woun't break
compatibility (users and API)
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-06-12
11:36:26 UTC (rev 5976)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-06-12
11:53:27 UTC (rev 5977)
@@ -624,8 +624,7 @@
}
catch (Throwable e)
{
- log.error("Rollback had a problem", e);
- throw new CacheException("A failure occured durring rollback!", e);
+ log.warn("Rollback had a problem", e);
}
finally
{
@@ -969,17 +968,11 @@
switch (status)
{
case Status.STATUS_COMMITTED:
- try
- {
- boolean onePhaseCommit = isOnePhaseCommit();
- if (log.isDebugEnabled()) log.debug("Running commit phase. One
phase? " + onePhaseCommit);
- runCommitPhase(ctx, gtx, modifications, onePhaseCommit);
- log.debug("Finished commit phase");
- break;
- } catch (Exception e)
- {
- log.trace("Caught exception on After completion", e);
- }
+ boolean onePhaseCommit = isOnePhaseCommit();
+ if (log.isDebugEnabled()) log.debug("Running commit phase. One
phase? " + onePhaseCommit);
+ runCommitPhase(ctx, gtx, modifications, onePhaseCommit);
+ log.debug("Finished commit phase");
+ break;
case Status.STATUS_UNKNOWN:
log.warn("Received JTA STATUS_UNKNOWN in afterCompletion()! XA
resources may not be in sync. The app should manually clean up resources at this
point.");
case Status.STATUS_MARKED_ROLLBACK:
@@ -993,6 +986,11 @@
throw new IllegalStateException("illegal status: " +
status);
}
}
+ catch (Exception th)
+ {
+ log.trace("Caught exception ", th);
+
+ }
finally
{
// clean up the tx table
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java 2008-06-12
11:36:26 UTC (rev 5976)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java 2008-06-12
11:53:27 UTC (rev 5977)
@@ -95,17 +95,13 @@
{
try
{
- // JBCACHE-360 -- to match JBossTM (and presumable the spec) a
- // rollback transaction should have status ROLLEDBACK before
+ // JBCACHE-360 -- to match JBossTM (and presumable the spec) a
+ // rollback transaction should have status ROLLEDBACK before
// calling afterCompletion().
//status=Status.STATUS_ROLLING_BACK;
status = Status.STATUS_ROLLEDBACK;
notifyAfterCompletion(Status.STATUS_ROLLEDBACK);
}
- catch (RuntimeException re)
- {
- throw re;
- }
catch (Throwable t)
{
}
@@ -285,15 +281,10 @@
{
s.afterCompletion(status);
}
- catch (RuntimeException t)
+ catch (Throwable t)
{
log.error("afterCompletion() failed for " + s, t);
- throw t;
}
- catch (Exception t)
- {
- log.error("afterCompletion() failed for " + s, t);
- }
}
participants.clear();
}
Modified:
core/trunk/src/test/java/org/jboss/cache/commands/read/GravitateDataCommandTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/commands/read/GravitateDataCommandTest.java 2008-06-12
11:36:26 UTC (rev 5976)
+++
core/trunk/src/test/java/org/jboss/cache/commands/read/GravitateDataCommandTest.java 2008-06-12
11:53:27 UTC (rev 5977)
@@ -30,7 +30,7 @@
IMocksControl control;
Fqn fqn = Fqn.fromString("/dummy");
InvocationContext ctx;
- BuddyFqnTransformer fqnTransformer;
+ BuddyFqnTransformer fqnTransformer = new BuddyFqnTransformer();
@BeforeMethod
public void setUp()