=== modified file 'interface/ndbapi/NdbTransaction.i'
--- a/interface/ndbapi/NdbTransaction.i	2008-05-08 16:14:03 +0000
+++ b/interface/ndbapi/NdbTransaction.i	2008-05-21 03:38:38 +0000
@@ -59,11 +59,6 @@
   NdbScanOperation* getNdbScanOperation(const char* aTableName);
   NdbOperation* getNdbErrorOperation();
 
-  %ndbnoexception;
-
-  // TODO: Verify that this can't throw?
-  const NdbOperation * getNextCompletedOperation(const NdbOperation * op)const;
-
 
   %ndbexception("NdbApiException,NdbApiTemporaryException,"
                 "NdbApiPermanentException,"
@@ -270,4 +265,8 @@
 
   %ndbnoexception;
 
+  const NdbOperation * getNextCompletedOperation(const NdbOperation * op=NULL) {
+    self->getNextCompletedOperation(op);
+  }
+
 };

=== modified file 'java/com/mysql/cluster/ndbj/NdbTransaction.java'
--- a/java/com/mysql/cluster/ndbj/NdbTransaction.java	2008-02-13 00:31:51 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbTransaction.java	2008-05-21 03:38:38 +0000
@@ -313,8 +313,9 @@
 	 * @throws IllegalStateException
 	 *             if the close method has already been called on the object.
 	 */
-	NdbOperation getNextCompletedOperation(NdbOperationImpl anOperation)
-			throws NdbApiException;
+	NdbOperation getNextCompletedOperation(NdbOperation anOperation);
+  
+	NdbOperation getNextCompletedOperation();
 
 	/**
 	 * closes the NdbTransaction object. The object can no longer be used after

=== modified file 'java/swig/NdbTransaction.i'
--- a/java/swig/NdbTransaction.i	2008-05-20 16:39:21 +0000
+++ b/java/swig/NdbTransaction.i	2008-05-21 03:38:38 +0000
@@ -28,14 +28,31 @@
 %typemap(javabase) NdbTransaction "NdbJtaTransaction";
 
 %rename(realClose) NdbTransaction::close;
+%typemap(javaout) NdbOperation * getNextCompletedOperation {
+ long cPtr = $jnicall;
+ return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner);
+}
+%rename(realGetNextCompletedOperation) NdbTransaction::getNextCompletedOperation;
+
 %typemap(javacode) NdbTransaction %{
   private final Map<Long, NdbOperationImpl> createdOperations = new HashMap<Long, NdbOperationImpl>();
   public void close() {
-    this.realClose();
+    try { 
+      this.realClose();
+    } catch (Exception e) { 
+    }
     this.swigCPtr=0;
   }
+  public NdbOperation getNextCompletedOperation(NdbOperation op) { 
+    return realGetNextCompletedOperation((NdbOperationImpl)op);
+  }
+  public NdbOperation getNextCompletedOperation() { 
+    return realGetNextCompletedOperation();
+  }
   %}
 
+
+
 %javamethodmodifiers NdbTransaction::getNdbOperation "@Override
   protected";
 
@@ -51,13 +68,16 @@
 %javamethodmodifiers NdbTransaction::execute "@Override
   public";
 
-%typemap(javaout) NdbOperation * {
+%typemap(javain) NdbOperation * "NdbOperationImpl.getCPtr((NdbOperationImpl)$javainput)";
+
+%typemap(javaout) NdbOperation *, NdbScanOperation *, 
+                  NdbIndexOperation *, NdbScanOperation * {
   long cPtr = $jnicall; 
   if (cPtr == 0) { 
     return null; 
   }
   
-  NdbOperationImpl theOperation = new $javaclassname(cPtr, $owner);
+  $javaclassname theOperation = new $javaclassname(cPtr, $owner);
   createdOperations.put(new Long(cPtr),
                         theOperation);
   return theOperation;
@@ -68,7 +88,8 @@
 /* NdbTransaction methods are the only place where we need to do
    save the Operatoins. Reset typemap. */
 
-%typemap(javaout) NdbOperation * { 
+%typemap(javaout) NdbOperation *, NdbScanOperation *, 
+                  NdbIndexOperation *, NdbScanOperation * { 
  long cPtr = $jnicall;
  return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner);
 }



