List:NDB Connectors« Previous MessageNext Message »
From:Monty Taylor Date:December 20 2007 12:06pm
Subject:Rev 385: Fixed a type error in NdbTransactionManager in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel
View as plain text  
At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/devel

------------------------------------------------------------
revno: 385
revision-id:mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Thu 2007-12-20 10:05:56 -0200
message:
  Fixed a type error in NdbTransactionManager
modified:
  java/com/mysql/cluster/ndbj/NdbTransactionManager.java
ndbtransactionmanage-20071220020348-va7lrb65xv544s7l-2
=== modified file 'java/com/mysql/cluster/ndbj/NdbTransactionManager.java'
--- a/java/com/mysql/cluster/ndbj/NdbTransactionManager.java	2007-12-20 02:45:12 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbTransactionManager.java	2007-12-20 12:05:56 +0000
@@ -7,6 +7,7 @@
 import javax.transaction.RollbackException;
 import javax.transaction.SystemException;
 import javax.transaction.TransactionManager;
+import javax.transaction.Transaction;
 
 public abstract class NdbTransactionManager implements TransactionManager {
 
@@ -50,13 +51,17 @@
 		return transaction;
 	}
 
-	public void resume(NdbTransaction arg0) throws InvalidTransactionException,
+	public void resume(Transaction arg0) throws InvalidTransactionException,
 			IllegalStateException, SystemException {
 		NdbTransaction transaction = context.get();
 		if (transaction != null) {
 			throw new IllegalStateException("Can't resume - already have a transaction");
+		} else if (arg0.getClass().isInstance(NdbTransaction.class)) { 
+			context.set((NdbTransaction)arg0);
+		} else { 
+			throw new InvalidTransactionException("Ndb only manages NdbTransactions");
 		}
-		context.set(arg0);
+		
 		throw new NotImplementedException("resume");
 
 	}

Thread
Rev 385: Fixed a type error in NdbTransactionManager in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/develMonty Taylor20 Dec