=== modified file 'java/swig/NdbOperation.i'
--- a/java/swig/NdbOperation.i	2008-05-19 19:08:14 +0000
+++ b/java/swig/NdbOperation.i	2008-05-20 16:39:21 +0000
@@ -41,11 +41,5 @@
 
 %typemap(javainterfaces) NdbOperation "NdbOperation";
 %typemap(javabase) NdbOperation "NdbBaseOperationEqualsImpl";
-%typemap(javaout) NdbOperation {
-  NdbOperationImpl theOperation = (NdbOperationImpl)$jnicall; 
-  createdOperations.put(new Long(NdbOperationImpl.getCPtr(theOperation)),
-                        theOperation);
-  return theOperation;
-}
 
 %include "ndbapi/NdbOperation.i"

=== modified file 'java/swig/NdbTransaction.i'
--- a/java/swig/NdbTransaction.i	2008-05-20 00:08:30 +0000
+++ b/java/swig/NdbTransaction.i	2008-05-20 16:39:21 +0000
@@ -24,14 +24,6 @@
 import java.util.HashMap;
 %}
 
-%typemap(in) NdbTransaction * %{
-  /* Prevent SEGV on null pointers */ 
-  if ($input == 0) {
-    NDB_exception(NdbApiException,"NdbTransaction Object is NULL. This state is usually encountered when using a transaction after it has been closed");
-    return $null;
-  }
-  $1=*(NdbTransaction **)&$input; 
-%}
 %typemap(javainterfaces) NdbTransaction "NdbTransaction";
 %typemap(javabase) NdbTransaction "NdbJtaTransaction";
 
@@ -59,5 +51,25 @@
 %javamethodmodifiers NdbTransaction::execute "@Override
   public";
 
+%typemap(javaout) NdbOperation * {
+  long cPtr = $jnicall; 
+  if (cPtr == 0) { 
+    return null; 
+  }
+  
+  NdbOperationImpl theOperation = new $javaclassname(cPtr, $owner);
+  createdOperations.put(new Long(cPtr),
+                        theOperation);
+  return theOperation;
+}
+
 %include "ndbapi/NdbTransaction.i"
 
+/* NdbTransaction methods are the only place where we need to do
+   save the Operatoins. Reset typemap. */
+
+%typemap(javaout) NdbOperation * { 
+ long cPtr = $jnicall;
+ return (cPtr == 0) ? null : new $javaclassname(cPtr, $owner);
+}
+  



