=== modified file 'TODO'
--- a/TODO	2008-03-07 11:24:28 +0000
+++ b/TODO	2008-04-10 10:16:11 +0000
@@ -121,3 +121,16 @@
     Port testBasic  and see how that goes. 
 
 
+**** 
+
+NDB/Memcached
+
+  C Lib that implements libmemcached interface but talks to ndb. 
+    Drop in replacement. 
+
+  Memcache/bindings wrap of that lib as well
+
+  Implement libmemcached interfaces using NDB/J. 
+
+  Need to make a proxy server/protocol for NDB that speaks memcached protocol 
+  - because otherwise it's almost impossible to use from PHP.

=== modified file 'acinclude.m4'
--- a/acinclude.m4	2008-03-28 07:22:03 +0000
+++ b/acinclude.m4	2008-04-10 10:16:11 +0000
@@ -279,7 +279,8 @@
     # add regular MySQL C flags
     ADDCFLAGS=`$MYSQL_CONFIG --cflags` 
     # add NdbAPI specific C flags
-    LDFLAGS="$LDFLAGS -L/usr/lib/mysql "`$MYSQL_CONFIG --libs_r`
+    LDFLAGS="$LDFLAGS -L/usr/lib/mysql -lndbclient -lmysys -lmystrings -ldbug "`$MYSQL_CONFIG --libs_r | sed 's/-lmysqlclient_r//'`
+    echo "LDFLAGS=**$LDFLAGS**"
 
     ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb"
     ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/ndbapi"
@@ -294,13 +295,13 @@
     MYSQL_INCLUDES="$IBASE $ADDIFLAGS"   
 
     
-    AC_CHECK_LIB([ndbclient],[decimal_bin_size],,[
-      AC_CHECK_LIB([ndbhelper],[decimal_bin_size],,[
-        AC_CHECK_LIB([mysys],[my_sync])
-        AC_CHECK_LIB([mystrings],[decimal_bin_size])
-      ])
-      AC_CHECK_LIB([ndbclient],[ndb_init],,[AC_MSG_ERROR([Can't link against libndbclient])])
-    ])
+    dnl AC_CHECK_LIB([ndbclient],[decimal_bin_size],,[
+    dnl   AC_CHECK_LIB([ndbhelper],[decimal_bin_size],,[
+    dnl     AC_CHECK_LIB([mystrings],[decimal_bin_size])
+    dnl     AC_CHECK_LIB([mysys],[my_sync])
+    dnl   ])
+    dnl   AC_CHECK_LIB([ndbclient],[ndb_init],,[AC_MSG_ERROR([Can't link against libndbclient])])
+    dnl ])
      
     AC_MSG_CHECKING(for NdbApi headers)
      AC_TRY_LINK([#include <NdbApi.hpp>], [int attr=NdbTransaction::Commit; ],

=== modified file 'interface/mgmapi/mgmglobals.i'
--- a/interface/mgmapi/mgmglobals.i	2008-02-16 17:04:54 +0000
+++ b/interface/mgmapi/mgmglobals.i	2008-04-10 10:16:11 +0000
@@ -35,7 +35,7 @@
 #include "config.h"
 
 #include "ndb_init.h"
-#include "storage/ndb/mgmapi/mgmapi.h"
+#include "mgmapi/mgmapi.h"
 #include "mgmapi_debug.h"
 
 

=== modified file 'interface/ndbapi/NdbIndexScanOperation.i'
--- a/interface/ndbapi/NdbIndexScanOperation.i	2008-03-09 17:13:18 +0000
+++ b/interface/ndbapi/NdbIndexScanOperation.i	2008-04-10 10:16:11 +0000
@@ -48,13 +48,9 @@
   }
 
 #if !defined(SWIG_RUBY_AUTORENAME)
-  %rename reset_bounds resetBounds;
-  %rename end_of_bound endOfBound;
   %rename get_range_no getRangeNo;
 #endif
 
-  voidint reset_bounds(bool forceSend = false);
-  voidint end_of_bound(Uint32 range_no);
   voidint get_range_no();
 
   virtual voidint readTuples(NdbOperation::LockMode lock_mode = LM_Read,

=== modified file 'interface/ndbapi/NdbScanOperation.i'
--- a/interface/ndbapi/NdbScanOperation.i	2008-03-09 17:13:18 +0000
+++ b/interface/ndbapi/NdbScanOperation.i	2008-04-10 10:16:11 +0000
@@ -60,7 +60,6 @@
   int nextResult(bool fetchAllowed = true, bool forceSend = false);
   voidint deleteCurrentTuple();
   voidint deleteCurrentTuple(NdbTransaction* takeOverTransaction);
-  voidint restart(bool forceSend = false);
 
   %ndbexception("NdbApiException") {
     $action

=== modified file 'java/Makefile.am'
--- a/java/Makefile.am	2008-03-07 11:26:02 +0000
+++ b/java/Makefile.am	2008-04-10 10:16:11 +0000
@@ -376,12 +376,11 @@
 
 lib_LTLIBRARIES = libndbj.la libmgmj.la 
 nodist_libndbj_la_SOURCES = ndbj.cxx
-libndbj_la_LIBADD = -lstdc++
 libndbj_la_LDFLAGS = -fPIC
-libndbj_la_CPPFLAGS = $(JAVA_CXXFLAGS) $(PTHREAD_CFLAGS) -fPIC
+libndbj_la_CPPFLAGS = $(JAVA_CXXFLAGS) $(PTHREAD_CFLAGS) -fPIC -DPIC
 nodist_libmgmj_la_SOURCES = mgmj.cxx events.cxx listeners.cxx
 libmgmj_la_CPPFLAGS = $(JAVA_CXXFLAGS) $(PTHREAD_CFLAGS) -fPIC
-libmgmj_la_LIBADD = ${top_builddir}/mgmpp/libmgmpp.la 
+libmgmj_la_LIBADD = ${top_builddir}/mgmpp/libmgmpp.la
 
 all-local: ndbj.jar  mgmj.jar 
 

=== modified file 'java/com/mysql/cluster/ndbj/NdbFactory.java'
--- a/java/com/mysql/cluster/ndbj/NdbFactory.java	2008-02-12 20:32:47 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbFactory.java	2008-04-10 10:16:11 +0000
@@ -3,6 +3,7 @@
 import java.util.Map;
 
 
+
 /**
  * NdbFactory is a class with a public static factory method for creating
  * an NdbClusterConnection object. NdbFactory also ensures that the JNI 
@@ -11,16 +12,22 @@
  */
 public class NdbFactory
 {
-		
-
-  static {
-    try {
-      System.loadLibrary("ndbj");
-    } catch (UnsatisfiedLinkError e) {
-      throw new RuntimeException("Native code library failed to load. \n" + e);
-    }
-    ndbj.ndb_init();
-  }
+
+	static boolean is_initted = false;
+
+	static {
+
+		if (!is_initted) {
+			try {
+				System.loadLibrary("ndbj");
+			} catch (UnsatisfiedLinkError e) {
+				throw new RuntimeException("Native code library failed to load. \n" + e);
+			}
+			ndbj.ndb_init();
+			is_initted = true;
+		}
+	}
+
 
     /**
      * One of the first methods typically called in a NDB/J application. 

=== modified file 'java/com/mysql/cluster/ndbj/NdbIndexScanOperation.java'
--- a/java/com/mysql/cluster/ndbj/NdbIndexScanOperation.java	2008-02-16 17:04:54 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbIndexScanOperation.java	2008-04-10 10:16:11 +0000
@@ -284,9 +284,6 @@
 			throws NdbApiException;
 	
 	
-	public void endOfBound(long range_no) 
-			throws NdbApiException;
-
 	public void whereGreaterThan(long columnId, double val) throws NdbApiException;
 
 	public void whereGreaterThan(String columnName, int val) throws NdbApiException;

=== modified file 'java/com/mysql/cluster/ndbj/NdbScanOperation.java'
--- a/java/com/mysql/cluster/ndbj/NdbScanOperation.java	2008-02-13 00:56:15 +0000
+++ b/java/com/mysql/cluster/ndbj/NdbScanOperation.java	2008-04-10 10:16:11 +0000
@@ -166,20 +166,6 @@
 	throws NdbApiException;
 
 	/**
-	 * Restart scan with exactly the same getValues and search conditions
-	 * @param boolean forceSend if true, do not buffer request, flush immediately to
-	 * cluster @return -1 on error, 0 on success
-	 * @throws NdbApiException if there is an internal problem in the cluster
-	 */
-	void restart(boolean forceSend) throws NdbApiException;
-
-	/**
-	 * Restart scan with exactly the same getValues and search conditions
-	 * @throws NdbApiException if there is an internal problem in the cluster
-	 */
-	void restart() throws NdbApiException;
-
-	/**
 	 * Creates a new NdbScanFilter that can be applied to
 	 * filter the results returned from the scan operation.
 	 * Note: call getValue() methods on the NdbScanOperation object

=== modified file 'java/ndbj.i'
--- a/java/ndbj.i	2008-03-07 11:26:02 +0000
+++ b/java/ndbj.i	2008-04-10 10:16:11 +0000
@@ -68,6 +68,18 @@
   }
 %}
 
+%pragma(java) jniclasscode=%{
+       static {
+
+                        try {
+                                System.loadLibrary("ndbj");
+                        } catch (UnsatisfiedLinkError e) {
+                                throw new RuntimeException("Native code library failed to load. \n" + e);
+                        }
+                        ndbj.ndb_init();
+        }
+%}
+
 
 %include "NdbClusterConnection.i"
 %include "Ndb.i"

=== modified file 'java/testsuite/BaseNdbjTestCase.java'
--- a/java/testsuite/BaseNdbjTestCase.java	2008-03-28 01:58:24 +0000
+++ b/java/testsuite/BaseNdbjTestCase.java	2008-04-10 10:16:11 +0000
@@ -33,11 +33,6 @@
 	protected static NdbClusterConnection ndbConn=null;
 	protected com.mysql.cluster.ndbj.Ndb ndb=null;
 	protected NdbTransaction trans=null;
-	
-	static { 
-  	    System.loadLibrary("ndbj");
-    	ndbj.ndb_init();
-	}
 
 	public BaseNdbjTestCase(String arg0) {
 
@@ -145,13 +140,14 @@
 	       *  Connect to cluster, done once for each Application
 	       */
 		super.setUp();
-		System.out.println("Running test: "+this.getClass().getName());
+		//System.out.println("Running test: "+this.getClass().getName());
 
-        //System.out.print("Connecting to cluster...");
+        //System.out.println("Connecting to cluster...");
         if (ndbConn==null) {
             ndbConn = NdbFactory.createNdbClusterConnection(NDB_MGMD_CONNECTSTRING);
-
+           
             ndbConn.connect(5,3,true);
+            
             ndbConn.waitUntilReady(30,0);
         }
           /**
@@ -159,7 +155,6 @@
            */
         ndb = ndbConn.createNdb("test",1024);
 
-        //System.out.println("connected");
 	}
 	
 	@Override

=== modified file 'java/testsuite/ndbj/OrderedIndexScanTest.java'
--- a/java/testsuite/ndbj/OrderedIndexScanTest.java	2007-12-27 02:37:27 +0000
+++ b/java/testsuite/ndbj/OrderedIndexScanTest.java	2008-04-10 10:16:11 +0000
@@ -58,9 +58,6 @@
 					NdbIndexScanOperation.BoundType.BoundEQ,
 					1);
 			*/
-			long bound_no=0;
-			iop.endOfBound(bound_no);
-
 
 			iop.getValue(col1);
 			iop.getValue(col2);

=== modified file 'mgmpp/libmgmpp.h'
--- a/mgmpp/libmgmpp.h	2008-03-11 13:55:15 +0000
+++ b/mgmpp/libmgmpp.h	2008-04-10 10:16:11 +0000
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #include "ndb_init.h"
-#include "storage/ndb/mgmapi/mgmapi.h"
+#include "mgmapi/mgmapi.h"
 #include "mgmapi_debug.h"
 
 #endif



