MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Craig L Russell Date:October 4 2010 6:23pm
Subject:bzr commit into clusterj branch (Craig.Russell:333)
View as plain text  
#At file:///Users/clr/ndb/root/clusterj-working/ based on revid:craig.russell@stripped

  333 Craig L Russell	2010-10-04
      Fix failure to set lock mode at transaction begin

    modified:
      clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java
      clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java
=== modified file 'clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java'
--- a/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java	2010-09-22 00:09:11 +0000
+++ b/clusterj-core/src/main/java/com/mysql/clusterj/core/SessionImpl.java	2010-10-04 18:23:11 +0000
@@ -599,6 +599,7 @@ public class SessionImpl implements Sess
     protected void internalBegin() {
         try {
             clusterTransaction = db.startTransaction(joinTransactionId);
+            clusterTransaction.setLockMode(lockmode);
             // if a transaction has already begun, tell the cluster transaction about the key
             if (partitionKey != null) {
                 clusterTransaction.setPartitionKey(partitionKey);
@@ -1139,6 +1140,10 @@ public class SessionImpl implements Sess
         clusterTransaction.setCoordinatedTransactionId(coordinatedTransactionId);
     }
 
+    /** Set the lock mode for subsequent operations. The lock mode takes effect immediately
+     * and continues until set again.
+     * @param lockmode the lock mode
+     */
     public void setLockMode(LockMode lockmode) {
         this.lockmode = lockmode;
         if (clusterTransaction != null) {

=== modified file 'clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java'
--- a/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java	2010-09-04 00:11:18 +0000
+++ b/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterTransactionImpl.java	2010-10-04 18:23:11 +0000
@@ -91,7 +91,7 @@ class ClusterTransactionImpl implements 
     /** Lock mode for index scan operations */
     private int indexScanLockMode = com.mysql.ndbjtie.ndbapi.NdbOperationConst.LockMode.LM_CommittedRead;
 
-    /** Lock mode for index scan operations */
+    /** Lock mode for table scan operations */
     private int tableScanLockMode = com.mysql.ndbjtie.ndbapi.NdbOperationConst.LockMode.LM_CommittedRead;
 
     /** Autocommit flag if we are in an autocommit transaction */
@@ -221,7 +221,7 @@ class ClusterTransactionImpl implements 
         handleError(ndbIndex, ndbDictionary);
         NdbIndexScanOperation ndbOperation = ndbTransaction.getNdbIndexScanOperation(ndbIndex);
         handleError(ndbOperation, ndbTransaction);
-        int lockMode = lookupLockMode;
+        int lockMode = indexScanLockMode;
         int scanFlags = 0;
         int parallel = 0;
         int batch = 0;
@@ -250,7 +250,7 @@ class ClusterTransactionImpl implements 
         handleError(ndbTable, ndbDictionary);
         NdbScanOperation ndbScanOperation = ndbTransaction.getNdbScanOperation(ndbTable);
         handleError(ndbScanOperation, ndbTransaction);
-        int lockMode = indexScanLockMode;
+        int lockMode = tableScanLockMode;
         int scanFlags = 0;
         int parallel = 0;
         int batch = 0;


Attachment: [text/bzr-bundle] bzr/craig.russell@oracle.com-20101004182311-inrptk3su5mhplgm.bundle
Thread
bzr commit into clusterj branch (Craig.Russell:333)Craig L Russell4 Oct