JBoss Cache SVN: r7583 - core/branches/flat/src/main/java/org/horizon/transaction.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-23 07:12:31 -0500 (Fri, 23 Jan 2009)
New Revision: 7583
Modified:
core/branches/flat/src/main/java/org/horizon/transaction/TransactionTable.java
Log:
Building GlobalTransaction to allow for local mode caches
Modified: core/branches/flat/src/main/java/org/horizon/transaction/TransactionTable.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/transaction/TransactionTable.java 2009-01-23 11:45:16 UTC (rev 7582)
+++ core/branches/flat/src/main/java/org/horizon/transaction/TransactionTable.java 2009-01-23 12:12:31 UTC (rev 7583)
@@ -293,7 +293,7 @@
//
GlobalTransaction gtx = get(tx);
if (gtx == null && createIfNotExists) {
- Address addr = rpcManager.getAddress();
+ Address addr = getAddress();
gtx = GlobalTransaction.create(addr);
if (trace) log.trace("Creating new GlobalTransaction " + gtx);
TransactionContext transactionContext;
@@ -311,6 +311,10 @@
return gtx;
}
+ private Address getAddress() {
+ return rpcManager == null ? null : rpcManager.getAddress();
+ }
+
public TransactionContext getTransactionContext(GlobalTransaction gtx) {
return gtxMapping.get(gtx);
}
15 years, 11 months
JBoss Cache SVN: r7582 - core/branches/flat/src/main/java/org/horizon/transaction.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-23 06:45:16 -0500 (Fri, 23 Jan 2009)
New Revision: 7582
Modified:
core/branches/flat/src/main/java/org/horizon/transaction/DummyTransaction.java
Log:
JBCACHE-1469: DummyBaseTransactionManager behaves incorrectly with Status.STATUS_MARKED_ROLLBACK
Modified: core/branches/flat/src/main/java/org/horizon/transaction/DummyTransaction.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/transaction/DummyTransaction.java 2009-01-23 11:42:35 UTC (rev 7581)
+++ core/branches/flat/src/main/java/org/horizon/transaction/DummyTransaction.java 2009-01-23 11:45:16 UTC (rev 7582)
@@ -189,6 +189,7 @@
throw new IllegalArgumentException("null synchronization " + this);
switch (status) {
+ case Status.STATUS_MARKED_ROLLBACK: // we should allow synchronizations to be registered even if the status is MARKED_ROLLBACK
case Status.STATUS_ACTIVE:
case Status.STATUS_PREPARING:
break;
@@ -198,8 +199,6 @@
throw new IllegalStateException("already started committing. " + this);
case Status.STATUS_COMMITTED:
throw new IllegalStateException("already committed. " + this);
- case Status.STATUS_MARKED_ROLLBACK:
- throw new RollbackException("already marked for rollback " + this);
case Status.STATUS_ROLLING_BACK:
throw new RollbackException("already started rolling back. " + this);
case Status.STATUS_ROLLEDBACK:
15 years, 11 months
JBoss Cache SVN: r7581 - core/trunk/src/main/java/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-23 06:42:35 -0500 (Fri, 23 Jan 2009)
New Revision: 7581
Modified:
core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
Log:
JBCACHE-1469: DummyBaseTransactionManager behaves incorrectly with Status.STATUS_MARKED_ROLLBACK
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java 2009-01-23 11:22:21 UTC (rev 7580)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/DummyTransaction.java 2009-01-23 11:42:35 UTC (rev 7581)
@@ -229,10 +229,13 @@
throws RollbackException, IllegalStateException, SystemException
{
if (sync == null)
+ {
throw new IllegalArgumentException("null synchronization " + this);
+ }
switch (status)
{
+ case Status.STATUS_MARKED_ROLLBACK:
case Status.STATUS_ACTIVE:
case Status.STATUS_PREPARING:
break;
@@ -242,8 +245,6 @@
throw new IllegalStateException("already started committing. " + this);
case Status.STATUS_COMMITTED:
throw new IllegalStateException("already committed. " + this);
- case Status.STATUS_MARKED_ROLLBACK:
- throw new RollbackException("already marked for rollback " + this);
case Status.STATUS_ROLLING_BACK:
throw new RollbackException("already started rolling back. " + this);
case Status.STATUS_ROLLEDBACK:
15 years, 11 months
JBoss Cache SVN: r7580 - core/branches/flat/src/main/java/org/horizon/transaction.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-23 06:22:21 -0500 (Fri, 23 Jan 2009)
New Revision: 7580
Modified:
core/branches/flat/src/main/java/org/horizon/transaction/DummyBaseTransactionManager.java
Log:
JBCACHE-1469: DummyBaseTransactionManager behaves incorrectly with Status.STATUS_MARKED_ROLLBACK
Modified: core/branches/flat/src/main/java/org/horizon/transaction/DummyBaseTransactionManager.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/transaction/DummyBaseTransactionManager.java 2009-01-23 11:18:14 UTC (rev 7579)
+++ core/branches/flat/src/main/java/org/horizon/transaction/DummyBaseTransactionManager.java 2009-01-23 11:22:21 UTC (rev 7580)
@@ -33,15 +33,14 @@
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
+import java.io.Serializable;
/**
* @author bela
- * <p/>
- * Date: May 15, 2003 Time: 4:11:37 PM
* @since 1.0
*/
-public class DummyBaseTransactionManager implements TransactionManager, java.io.Serializable {
- static ThreadLocal<Transaction> thread_local = new ThreadLocal<Transaction>();
+public class DummyBaseTransactionManager implements TransactionManager, Serializable {
+ static ThreadLocal<DummyTransaction> thread_local = new ThreadLocal<DummyTransaction>();
private static final long serialVersionUID = -6716097342564237376l;
private static final Log log = LogFactory.getLog(DummyBaseTransactionManager.class);
private static final boolean trace = log.isTraceEnabled();
@@ -84,13 +83,17 @@
HeuristicRollbackException, SecurityException,
IllegalStateException, SystemException {
int status;
- Transaction tx = getTransaction();
+ DummyTransaction tx = getTransaction();
if (tx == null)
throw new IllegalStateException("thread not associated with transaction");
status = tx.getStatus();
- if (status == Status.STATUS_MARKED_ROLLBACK)
- throw new RollbackException();
- tx.commit();
+ if (status == Status.STATUS_MARKED_ROLLBACK) {
+ tx.setStatus(Status.STATUS_ROLLEDBACK);
+ rollback();
+ throw new RollbackException("Transaction status is Status.STATUS_MARKED_ROLLBACK");
+ } else {
+ tx.commit();
+ }
// Disassociate tx from thread.
setTransaction(null);
@@ -155,7 +158,7 @@
* @throws javax.transaction.SystemException
* If the transaction service fails in an unexpected way.
*/
- public Transaction getTransaction() throws SystemException {
+ public DummyTransaction getTransaction() throws SystemException {
return thread_local.get();
}
@@ -208,7 +211,7 @@
* @param tx
*/
public void setTransaction(Transaction tx) {
- thread_local.set(tx);
+ thread_local.set((DummyTransaction) tx);
}
}
15 years, 11 months
JBoss Cache SVN: r7579 - core/trunk/src/main/java/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-23 06:18:14 -0500 (Fri, 23 Jan 2009)
New Revision: 7579
Modified:
core/trunk/src/main/java/org/jboss/cache/transaction/DummyBaseTransactionManager.java
Log:
JBCACHE-1469: DummyBaseTransactionManager behaves incorrectly with Status.STATUS_MARKED_ROLLBACK
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/DummyBaseTransactionManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/DummyBaseTransactionManager.java 2009-01-23 09:00:21 UTC (rev 7578)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/DummyBaseTransactionManager.java 2009-01-23 11:18:14 UTC (rev 7579)
@@ -39,7 +39,7 @@
*/
public class DummyBaseTransactionManager implements TransactionManager, java.io.Serializable
{
- static ThreadLocal<Transaction> thread_local = new ThreadLocal<Transaction>();
+ static ThreadLocal<DummyTransaction> thread_local = new ThreadLocal<DummyTransaction>();
private static final long serialVersionUID = -6716097342564237376l;
/**
@@ -57,8 +57,10 @@
{
Transaction currentTx;
if ((currentTx = getTransaction()) != null)
+ {
throw new NotSupportedException(Thread.currentThread() +
" is already associated with a transaction (" + currentTx + ")");
+ }
DummyTransaction tx = new DummyTransaction(this);
setTransaction(tx);
}
@@ -90,13 +92,22 @@
IllegalStateException, SystemException
{
int status;
- Transaction tx = getTransaction();
+ DummyTransaction tx = getTransaction();
if (tx == null)
+ {
throw new IllegalStateException("thread not associated with transaction");
+ }
status = tx.getStatus();
if (status == Status.STATUS_MARKED_ROLLBACK)
- throw new RollbackException();
- tx.commit();
+ {
+ tx.setStatus(Status.STATUS_ROLLEDBACK);
+ rollback();
+ throw new RollbackException("Transaction status is Status.STATUS_MARKED_ROLLBACK");
+ }
+ else
+ {
+ tx.commit();
+ }
// Disassociate tx from thread.
setTransaction(null);
@@ -121,7 +132,9 @@
{
Transaction tx = getTransaction();
if (tx == null)
+ {
throw new IllegalStateException("no transaction associated with thread");
+ }
tx.rollback();
// Disassociate tx from thread.
@@ -145,7 +158,9 @@
{
Transaction tx = getTransaction();
if (tx == null)
+ {
throw new IllegalStateException("no transaction associated with calling thread");
+ }
tx.setRollbackOnly();
}
@@ -176,7 +191,7 @@
* If the transaction service fails in an
* unexpected way.
*/
- public Transaction getTransaction() throws SystemException
+ public DummyTransaction getTransaction() throws SystemException
{
return thread_local.get();
}
@@ -243,7 +258,7 @@
*/
public void setTransaction(Transaction tx)
{
- thread_local.set(tx);
+ thread_local.set((DummyTransaction) tx);
}
}
15 years, 11 months
JBoss Cache SVN: r7578 - in core/tags/1.4.1.SP12: src/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-23 04:00:21 -0500 (Fri, 23 Jan 2009)
New Revision: 7578
Modified:
core/tags/1.4.1.SP12/build.xml
core/tags/1.4.1.SP12/src/org/jboss/cache/Version.java
Log:
1.4.1.SP12
Modified: core/tags/1.4.1.SP12/build.xml
===================================================================
--- core/tags/1.4.1.SP12/build.xml 2009-01-23 08:33:18 UTC (rev 7577)
+++ core/tags/1.4.1.SP12/build.xml 2009-01-23 09:00:21 UTC (rev 7578)
@@ -6,7 +6,7 @@
<property name="module.name" value="JBossCache"/>
<!--We now requires version to have no white space since Ant+JBossAop will sometime choke. -->
- <property name="module.version" value="1.4.1-SNAPSHOT"/>
+ <property name="module.version" value="1.4.1.SP12"/>
<property name="implementation.url" value="http://www.jboss.com/products/jbosscache"/>
<property file="build.properties"/>
<property name="root.dir" value="${basedir}"/>
Modified: core/tags/1.4.1.SP12/src/org/jboss/cache/Version.java
===================================================================
--- core/tags/1.4.1.SP12/src/org/jboss/cache/Version.java 2009-01-23 08:33:18 UTC (rev 7577)
+++ core/tags/1.4.1.SP12/src/org/jboss/cache/Version.java 2009-01-23 09:00:21 UTC (rev 7578)
@@ -10,10 +10,9 @@
*/
public class Version
{
- public static final String version = "1.4.1-SNAPSHOT";
+ public static final String version = "1.4.1.SP12";
public static final String codename = "Cayenne";
- public static byte[] version_id = {'0', '1', '4', '1'};
- public static final String cvs = "$Id$";
+ public static byte[] version_id = {'0', '1', '4', '1', 'S', 'P', '1', '2'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
@@ -31,7 +30,6 @@
{
System.out.println("\nVersion: \t" + version);
System.out.println("Codename: \t" + codename);
- System.out.println("CVS: \t" + cvs);
System.out.println("History: \t(see http://jira.jboss.com/jira/browse/JBCACHE for details)\n");
}
@@ -39,7 +37,7 @@
* Returns version information as a string.
*/
public static String printVersion() {
- return "JBossCache '" + codename + "' " + version + "[ " + cvs + "]";
+ return "JBossCache '" + codename + "' " + version;
}
public static String printVersionId(byte[] v, int len)
15 years, 11 months
JBoss Cache SVN: r7577 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-01-23 03:33:18 -0500 (Fri, 23 Jan 2009)
New Revision: 7577
Added:
core/tags/1.4.1.SP12/
Log:
Tagged 1.4.1.SP12
Copied: core/tags/1.4.1.SP12 (from rev 7576, core/branches/1.4.X)
15 years, 11 months