At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/ndbjmerge
------------------------------------------------------------
revno: 228
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: ndbjmerge
timestamp: Thu 2007-11-01 14:23:46 +0000
message:
Force Ndb::init() to be called in createNdb(). Made init() be a no-op and deprecated it.
modified:
java/com/mysql/cluster/ndbj/Ndb.java ndb.java-20070517181935-98huwjarzuh25b30-2
swig/Ndb.i ndb.i-20070228021421-qkr4cbpxymyqdrf3-1
swig/NdbClusterConnection.i ndb_cluster_connecti-20070228021421-qkr4cbpxymyqdrf3-6
=== modified file 'java/com/mysql/cluster/ndbj/Ndb.java'
--- a/java/com/mysql/cluster/ndbj/Ndb.java 2007-10-29 17:51:35 +0000
+++ b/java/com/mysql/cluster/ndbj/Ndb.java 2007-11-01 14:23:46 +0000
@@ -49,6 +49,7 @@
* @throws NdbApiException if an error occured in the native library
* @throws IllegalStateException if the close method has already been called on the
object.
*/
+ @Deprecated
public abstract int init(int maxNumberOfTransactions) throws NdbApiException;
/**
=== modified file 'swig/Ndb.i'
--- a/swig/Ndb.i 2007-10-29 17:51:35 +0000
+++ b/swig/Ndb.i 2007-11-01 14:23:46 +0000
@@ -78,14 +78,14 @@
- %ndbexception("NdbApiException") init {
+/* %ndbexception("NdbApiException") init {
$action
if (result) {
NDB_exception(NdbApiException,"Cluster not ready");
}
}
int init(int maxNoOfTransactions = 4);
-
+*/
/* %ndbexception("NdbApiException") getAutoIncrementValue {
$action
if (result == 0) {
@@ -107,6 +107,19 @@
%extend Ndb {
public:
+
+
+ %ndbexception("NdbApiException") init {
+ $action
+ if (result) {
+ NDB_exception(NdbApiException,"Cluster not ready");
+ }
+ }
+ int init(int maxNoOfTransactions = 4) {
+ /* This is becoming a no-op, since we're forcing it */
+ return 0;
+ }
+
%ndbexception("NdbApiException") {
$action
if (result==(Uint64)-1) {
=== modified file 'swig/NdbClusterConnection.i'
--- a/swig/NdbClusterConnection.i 2007-10-28 00:05:03 +0000
+++ b/swig/NdbClusterConnection.i 2007-11-01 14:23:46 +0000
@@ -87,9 +87,13 @@
NDB_exception(NdbApiException,"Couldn't allocate an Ndb object");
}
}
- Ndb* createNdb(const char* aCatalogName="", const char* aSchemaName="def", int
initThreads = 0) {
+ %contract createNdb(const char* aCatalogName, const char* aSchemaName, Int32
initThreads) {
+ require:
+ initThreads > 0;
+ }
+ Ndb* createNdb(const char* aCatalogName="", const char* aSchemaName="def", Int32
initThreads = 4) {
Ndb * theNdb = new Ndb(self,aCatalogName,aSchemaName);
- if ((theNdb!=NULL) && (initThreads >0)) {
+ if (theNdb!=NULL) {
int ret = theNdb->init(initThreads);
if ( ret ) {
delete theNdb;
@@ -98,9 +102,13 @@
}
return theNdb;
}
- Ndb* createNdb(const char* aCatalogName, int initThreads = 0) {
+ %contract createNdb(const char* aCatalogName, Int32 initThreads) {
+ require:
+ initThreads > 0;
+ }
+ Ndb* createNdb(const char* aCatalogName, Int32 initThreads = 4) {
Ndb * theNdb = new Ndb(self,aCatalogName);
- if ((theNdb!=NULL) && (initThreads > 0)) {
+ if (theNdb!=NULL) {
int ret = theNdb->init(initThreads);
if ( ret ) {
delete theNdb;
| Thread |
|---|
| • Rev 228: Force Ndb::init() to be called in createNdb(). Made init() be a no-op and deprecated it. in http://bazaar.launchpad.net/~ndb-connectors/ndb-... | Monty Taylor | 1 Nov |