]> git.pld-linux.org Git - packages/db.git/blob - patch.4.2.52.3
- save from http://www.oracle.com/technology/products/berkeley-db/db/update/4.2.52...
[packages/db.git] / patch.4.2.52.3
1 --- java/src/com/sleepycat/db/DbEnv.java        2003-12-03 16:26:27.000000000 -0500
2 +++ java/src/com/sleepycat/db/DbEnv.java        2004-03-18 15:15:42.000000000 -0500
3 @@ -61,7 +61,7 @@
4      // Internally, the JNI layer creates a global reference to each DbEnv,
5      // which can potentially be different to this.  We keep a copy here so
6      // we can clean up after destructors.
7 -    private Object dbenv_ref;
8 +    private long dbenv_ref;
9      private DbAppDispatch app_dispatch_handler;
10      private DbEnvFeedbackHandler env_feedback_handler;
11      private DbErrorHandler error_handler;
12 @@ -94,7 +94,7 @@
13      void cleanup() {
14          swigCPtr = 0;
15          db_java.deleteRef0(dbenv_ref);
16 -        dbenv_ref = null;
17 +        dbenv_ref = 0L;
18      }
19  
20  
21 --- java/src/com/sleepycat/db/Db.java   2003-12-03 16:26:25.000000000 -0500
22 +++ java/src/com/sleepycat/db/Db.java   2004-03-18 15:15:55.000000000 -0500
23 @@ -57,7 +57,7 @@
24      // Internally, the JNI layer creates a global reference to each Db,
25      // which can potentially be different to this.  We keep a copy here so
26      // we can clean up after destructors.
27 -    private Object db_ref;
28 +    private long db_ref;
29      private DbEnv dbenv;
30      private boolean private_dbenv;
31      private DbAppendRecno append_recno_handler;
32 @@ -84,7 +84,7 @@
33      private void cleanup() {
34          swigCPtr = 0;
35          db_java.deleteRef0(db_ref);
36 -        db_ref = null;
37 +        db_ref = 0L;
38          if (private_dbenv) {
39              dbenv.cleanup();
40          }
41 --- java/src/com/sleepycat/db/db_java.java      2003-12-03 16:10:54.000000000 -0500
42 +++ java/src/com/sleepycat/db/db_java.java      2004-03-18 15:17:24.000000000 -0500
43 @@ -14,15 +14,15 @@
44      db_javaJNI.DbEnv_lock_vec(DbEnv.getCPtr(dbenv), locker, flags, list, offset, nlist);
45    }
46  
47 -   static Object initDbEnvRef0(DbEnv self, Object handle) {
48 +   static long initDbEnvRef0(DbEnv self, Object handle) {
49      return db_javaJNI.initDbEnvRef0(DbEnv.getCPtr(self), handle);
50    }
51  
52 -   static Object initDbRef0(Db self, Object handle) {
53 +   static long initDbRef0(Db self, Object handle) {
54      return db_javaJNI.initDbRef0(Db.getCPtr(self), handle);
55    }
56  
57 -   static void deleteRef0(Object ref) {
58 +   static void deleteRef0(long ref) {
59      db_javaJNI.deleteRef0(ref);
60    }
61  
62 --- java/src/com/sleepycat/db/db_javaJNI.java   2003-12-03 16:10:55.000000000 -0500
63 +++ java/src/com/sleepycat/db/db_javaJNI.java   2004-03-18 15:16:18.000000000 -0500
64 @@ -45,9 +45,9 @@
65         static native final void initialize();
66  
67    public final static native void DbEnv_lock_vec(long jarg1, int jarg2, int jarg3, DbLockRequest[] jarg4, int jarg5, int jarg6) throws DbException;
68 -   final static native Object initDbEnvRef0(long jarg1, Object jarg2);
69 -   final static native Object initDbRef0(long jarg1, Object jarg2);
70 -   final static native void deleteRef0(Object jarg1);
71 +   final static native long initDbEnvRef0(long jarg1, Object jarg2);
72 +   final static native long initDbRef0(long jarg1, Object jarg2);
73 +   final static native void deleteRef0(long jarg1);
74     final static native long getDbEnv0(long jarg1);
75    public final static native long new_Db(long jarg1, int jarg2) throws DbException;
76    public final static native void Db_associate(long jarg1, long jarg2, long jarg3, DbSecondaryKeyCreate jarg4, int jarg5) throws DbException;
77 --- libdb_java/db_java.i        2003-11-17 15:00:52.000000000 -0500
78 +++ libdb_java/db_java.i        2004-03-18 09:21:14.000000000 -0500
79 @@ -53,7 +53,7 @@
80         // Internally, the JNI layer creates a global reference to each DbEnv,
81         // which can potentially be different to this.  We keep a copy here so
82         // we can clean up after destructors.
83 -       private Object dbenv_ref;
84 +       private long dbenv_ref;
85         private DbAppDispatch app_dispatch_handler;
86         private DbEnvFeedbackHandler env_feedback_handler;
87         private DbErrorHandler error_handler;
88 @@ -76,7 +76,7 @@
89         void cleanup() {
90                 swigCPtr = 0;
91                 db_java.deleteRef0(dbenv_ref);
92 -               dbenv_ref = null;
93 +               dbenv_ref = 0L;
94         }
95  
96         public synchronized void close(int flags) throws DbException {
97 @@ -220,7 +220,7 @@
98         // Internally, the JNI layer creates a global reference to each Db,
99         // which can potentially be different to this.  We keep a copy here so
100         // we can clean up after destructors.
101 -       private Object db_ref;
102 +       private long db_ref;
103         private DbEnv dbenv;
104         private boolean private_dbenv;
105         private DbAppendRecno append_recno_handler;
106 @@ -245,7 +245,7 @@
107         private void cleanup() {
108                 swigCPtr = 0;
109                 db_java.deleteRef0(db_ref);
110 -               db_ref = null;
111 +               db_ref = 0L;
112                 if (private_dbenv)
113                         dbenv.cleanup();
114                 dbenv = null;
115 @@ -503,46 +503,42 @@
116         }
117  %}
118  
119 -%native(initDbEnvRef0) jobject initDbEnvRef0(DB_ENV *self, void *handle);
120 -%native(initDbRef0) jobject initDbRef0(DB *self, void *handle);
121 -%native(deleteRef0) void deleteRef0(jobject ref);
122 +%native(initDbEnvRef0) jlong initDbEnvRef0(DB_ENV *self, void *handle);
123 +%native(initDbRef0) jlong initDbRef0(DB *self, void *handle);
124 +%native(deleteRef0) void deleteRef0(jlong ref);
125  %native(getDbEnv0) DB_ENV *getDbEnv0(DB *self);
126  
127  %{
128 -JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
129 +JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
130      JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
131         DB_ENV *self = *(DB_ENV **)&jarg1;
132 +       jlong ret;
133         COMPQUIET(jcls, NULL);
134  
135         DB_ENV_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
136         self->set_errpfx(self, (const char*)self);
137 -       return (jobject)DB_ENV_INTERNAL(self);
138 +       *(jobject *)&ret = (jobject)DB_ENV_INTERNAL(self);
139 +       return (ret);
140  }
141  
142 -JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
143 +JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
144      JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
145         DB *self = *(DB **)&jarg1;
146 +       jlong ret;
147         COMPQUIET(jcls, NULL);
148  
149         DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
150 -       return (jobject)DB_INTERNAL(self);
151 +       *(jobject *)&ret = (jobject)DB_INTERNAL(self);
152 +       return (ret);
153  }
154  
155  JNIEXPORT void JNICALL Java_com_sleepycat_db_db_1javaJNI_deleteRef0(
156 -    JNIEnv *jenv, jclass jcls, jobject jref) {
157 -       COMPQUIET(jcls, NULL);
158 -
159 -       if (jref != NULL)
160 -               (*jenv)->DeleteGlobalRef(jenv, jref);
161 -}
162 -
163 -JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbRef0(
164      JNIEnv *jenv, jclass jcls, jlong jarg1) {
165 -       DB *self = *(DB **)&jarg1;
166 +       jobject jref = *(jobject *)&jarg1;
167         COMPQUIET(jcls, NULL);
168 -       COMPQUIET(jenv, NULL);
169  
170 -       return (jobject)DB_INTERNAL(self);
171 +       if (jref != 0L)
172 +               (*jenv)->DeleteGlobalRef(jenv, jref);
173  }
174  
175  JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
176 @@ -554,7 +550,7 @@
177         COMPQUIET(jcls, NULL);
178  
179         *(DB_ENV **)&env_cptr = self->dbenv;
180 -       return env_cptr;
181 +       return (env_cptr);
182  }
183  
184  JNIEXPORT jboolean JNICALL
185 --- libdb_java/db_java_wrap.c   2003-12-03 16:10:36.000000000 -0500
186 +++ libdb_java/db_java_wrap.c   2004-03-18 12:18:58.000000000 -0500
187 @@ -1192,40 +1192,36 @@
188  }
189  
190  
191 -JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
192 +JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
193      JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
194         DB_ENV *self = *(DB_ENV **)&jarg1;
195 +       jlong ret;
196         COMPQUIET(jcls, NULL);
197  
198         DB_ENV_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
199         self->set_errpfx(self, (const char*)self);
200 -       return (jobject)DB_ENV_INTERNAL(self);
201 +       *(jobject *)&ret = (jobject)DB_ENV_INTERNAL(self);
202 +       return (ret);
203  }
204  
205 -JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
206 +JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
207      JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
208         DB *self = *(DB **)&jarg1;
209 +       jlong ret;
210         COMPQUIET(jcls, NULL);
211  
212         DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
213 -       return (jobject)DB_INTERNAL(self);
214 +       *(jobject *)&ret = (jobject)DB_INTERNAL(self);
215 +       return (ret);
216  }
217  
218  JNIEXPORT void JNICALL Java_com_sleepycat_db_db_1javaJNI_deleteRef0(
219 -    JNIEnv *jenv, jclass jcls, jobject jref) {
220 -       COMPQUIET(jcls, NULL);
221 -
222 -       if (jref != NULL)
223 -               (*jenv)->DeleteGlobalRef(jenv, jref);
224 -}
225 -
226 -JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbRef0(
227      JNIEnv *jenv, jclass jcls, jlong jarg1) {
228 -       DB *self = *(DB **)&jarg1;
229 +       jobject jref = *(jobject *)&jarg1;
230         COMPQUIET(jcls, NULL);
231 -       COMPQUIET(jenv, NULL);
232  
233 -       return (jobject)DB_INTERNAL(self);
234 +       if (jref != 0L)
235 +               (*jenv)->DeleteGlobalRef(jenv, jref);
236  }
237  
238  JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
239 @@ -1237,7 +1233,7 @@
240         COMPQUIET(jcls, NULL);
241  
242         *(DB_ENV **)&env_cptr = self->dbenv;
243 -       return env_cptr;
244 +       return (env_cptr);
245  }
246  
247  JNIEXPORT jboolean JNICALL
This page took 0.06778 seconds and 3 git commands to generate.