At http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3
------------------------------------------------------------
revno: 246
revision-id: mtaylor@stripped
parent: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: telco-6.3
timestamp: Sat 2007-11-24 21:12:04 -0800
message:
Merged.
modified:
java/ndbj.i ndbj.i-20070913223244-5938mztpztyn9sry-1
java/testsuite/ndbj/OutOfConnectionProblemTest.java
outofconnectionprobl-20071114201416-ycjx0i6uz5umawy0-1
------------------------------------------------------------
revno: 192.1.25.1.70
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Sat 2007-11-24 21:08:52 -0800
message:
Fixed OutOfConnectionProblemTest
modified:
java/testsuite/ndbj/OutOfConnectionProblemTest.java
outofconnectionprobl-20071114201416-ycjx0i6uz5umawy0-1
------------------------------------------------------------
revno: 192.1.25.1.69
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Fri 2007-11-23 20:30:22 -0800
message:
Removed another spurious malloc of too much memory.
modified:
java/ndbj.i ndbj.i-20070913223244-5938mztpztyn9sry-1
------------------------------------------------------------
revno: 192.1.25.1.68
revision-id: mtaylor@stripped
parent: mtaylor@stripped
committer: Monty Taylor <mtaylor@stripped>
branch nick: devel
timestamp: Fri 2007-11-23 20:25:00 -0800
message:
Added full path named exceptions to both exception methods.
modified:
java/ndbj.i ndbj.i-20070913223244-5938mztpztyn9sry-1
=== modified file 'java/ndbj.i'
--- a/java/ndbj.i 2007-11-24 04:18:07 +0000
+++ b/java/ndbj.i 2007-11-25 05:12:04 +0000
@@ -84,14 +84,19 @@
#define NDB_exception_err(excp, msg, err) { ndb_throw_exception(jenv, #excp,msg, err); }
void ndb_throw_exception(JNIEnv *jenv, const char * excp, const char *msg) {
+ jclass clazz = NULL;
const char * prefix = "com/mysql/cluster/ndbj/";
- char * exception = (char *)malloc(strlen(excp)+strlen(prefix)+1);
- strcpy(exception,prefix);
- strcat(exception,excp);
+ if (strncmp(excp,"com.",4)) {
+ clazz = jenv->FindClass(excp);
+ } else {
+ char * exception = (char *)malloc(strlen(excp)+strlen(prefix)+1);
+ strcpy(exception,prefix);
+ strcat(exception,excp);
- //jclass clazz = jenv->FindClass("java/lang/RuntimeException");
- jclass clazz = jenv->FindClass(exception);
- free(exception);
+ //jclass clazz = jenv->FindClass("java/lang/RuntimeException");
+ jclass clazz = jenv->FindClass(exception);
+ free(exception);
+ }
jenv->ThrowNew(clazz,msg);
jenv->DeleteLocalRef(clazz);
@@ -267,12 +272,12 @@
%typemap(in) (unsigned noOfNames, const char ** names) {
Uint32 i = 0;
$1 = jenv->GetArrayLength($input);
- $2 = (char **) malloc(($1+1)*sizeof(char *));
+ $2 = (char **) malloc(($1+1));
/* make a copy of each string */
for (i = 0; i<$1; i++) {
jstring j_string = (jstring)(jenv->GetObjectArrayElement($input, i));
const char * c_string = jenv->GetStringUTFChars(j_string, 0);
- $2[i] = (char *)malloc(strlen((c_string)+1)*sizeof(const char *));
+ $2[i] = (char *)malloc(strlen((c_string)+1));
strcpy($2[i], c_string);
jenv->ReleaseStringUTFChars(j_string, c_string);
jenv->DeleteLocalRef(j_string);
=== modified file 'java/testsuite/ndbj/OutOfConnectionProblemTest.java'
--- a/java/testsuite/ndbj/OutOfConnectionProblemTest.java 2007-11-17 20:12:22 +0000
+++ b/java/testsuite/ndbj/OutOfConnectionProblemTest.java 2007-11-25 05:08:52 +0000
@@ -1,7 +1,5 @@
package testsuite.ndbj;
-import java.util.*;
-import java.sql.Timestamp;
import testsuite.BaseNdbjTestCase;
import com.mysql.cluster.ndbj.*;
@@ -81,7 +79,8 @@
iteration++) {
generateRequestTxs(iteration);
- int x=sendPollNdb(TRANSACTIONS_TIMEOUT, NUM_TRANSACTIONS, FORCE_SEND);
+ sendPollNdb(TRANSACTIONS_TIMEOUT, NUM_TRANSACTIONS, FORCE_SEND);
+ System.gc(); System.runFinalization();
}
System.out.println("Performing cooldown");
@@ -110,15 +109,12 @@
NdbOperation orderOp;
BaseCallback callback;
- Hashtable ht= new Hashtable();
-
try {
for (int elementCount = 1;
elementCount < (NUMBER_OF_ELEMENT_INSERTIONS) + 1;
elementCount++) {
- int id = (NUMBER_OF_ELEMENT_INSERTIONS * theLastBatch) + elementCount;
cnt++;
trans = startCountedTransaction();
| Thread |
|---|
| • Rev 246: Merged. in http://bazaar.launchpad.net/~ndb-connectors/ndb-connectors/telco-6.3 | Monty Taylor | 25 Nov |