automatic version update by autodist [release 6.2.32-1mamba;Wed Dec 20 2017]

This commit is contained in:
Automatic Build System 2024-01-05 21:39:24 +01:00
parent 15db6be653
commit 49b75d75cb
6 changed files with 4153 additions and 0 deletions

View File

@ -1,2 +1,7 @@
# db # db
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.

39
bdb-transactions.diff Normal file
View File

@ -0,0 +1,39 @@
--- db4-4.2.52/dbinc/db.in.orig 2004-09-09 18:29:17.987387000 -0700
+++ db4-4.2.52/dbinc/db.in 2004-09-09 18:30:00.547903000 -0700
@@ -839,6 +839,7 @@
#define TXN_NOWAIT 0x040 /* Do not wait on locks. */
#define TXN_RESTORED 0x080 /* Transaction has been restored. */
#define TXN_SYNC 0x100 /* Sync on prepare and commit. */
+#define TXN_NOLOG 0x200 /* Do not log this transaction. */
u_int32_t flags;
};
--- db4-4.2.52/txn/txn.c.orig 2004-09-09 18:30:36.348345000 -0700
+++ db4-4.2.52/txn/txn.c 2004-09-09 18:32:14.559561000 -0700
@@ -127,7 +127,7 @@
if ((ret = __db_fchk(dbenv,
"txn_begin", flags,
DB_DIRTY_READ | DB_TXN_NOWAIT |
- DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0)
+ DB_TXN_NOSYNC | DB_TXN_SYNC | DB_TXN_NOT_DURABLE )) != 0)
return (ret);
if ((ret = __db_fcchk(dbenv,
"txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
@@ -193,6 +193,8 @@
F_SET(txn, TXN_SYNC);
if (LF_ISSET(DB_TXN_NOWAIT))
F_SET(txn, TXN_NOWAIT);
+ if (LF_ISSET(DB_TXN_NOT_DURABLE))
+ F_SET(txn, TXN_NOLOG);
if ((ret = __txn_begin_int(txn, 0)) != 0)
goto err;
@@ -328,7 +330,7 @@
* We should set this value when we write the first log record, not
* here.
*/
- if (DBENV_LOGGING(dbenv))
+ if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
__log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
else
ZERO_LSN(begin_lsn);

20
btree.diff Normal file
View File

@ -0,0 +1,20 @@
--- db4-4.2.52/btree/bt_rec.c.orig 2003-09-13 11:48:58.000000000 -0700
+++ db4-4.2.52/btree/bt_rec.c 2005-05-04 13:25:29.349243000 -0700
@@ -222,7 +222,7 @@
* previous-page pointer updated to our new page. The next
* page must exist because we're redoing the operation.
*/
- if (!rootsplit && !IS_ZERO_LSN(argp->nlsn)) {
+ if (!rootsplit && argp->npgno != PGNO_INVALID ) {
if ((ret =
__memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
ret = __db_pgerr(file_dbp, argp->npgno, ret);
@@ -294,7 +294,7 @@
* possible that the next-page never existed, we ignore it as
* if there's nothing to undo.
*/
- if (!rootsplit && !IS_ZERO_LSN(argp->nlsn)) {
+ if (!rootsplit && argp->npgno != PGNO_INVALID) {
if ((ret =
__memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
np = NULL;

308
db.spec Normal file
View File

@ -0,0 +1,308 @@
%define majver %(echo %version | cut -d . -f1-2)
%define MAJver %(echo %version | cut -d . -f1)
%define majvershort %(echo %version | cut -d . -f1-2 | tr -d .)
Name: db
Version: 6.2.32
Release: 1mamba
Summary: The Berkeley DB database library
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.oracle.com/technology/products/berkeley-db/index.html
Source: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
Patch2: db4-jni-casting.diff
# from http://www.stanford.edu/services/directory/openldap/configuration/patches/db/
Patch3: bdb-transactions.diff
Patch4: btree.diff
Patch5: java.diff
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END
%if "%{stage1}" != "1"
BuildRequires: jpackage-utils
BuildRequires: jdk
%endif
BuildRequires: sharutils
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.
%package -n lib%{name}
Summary: The Berkeley DB database library
Group: System/Libraries
%description -n lib%{name}
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
The Berkeley DB includes B+tree, Extended Linear Hashing, Fixed and Variable-length record access methods, transactions, locking, logging, shared memory caching, and database recovery.
The Berkeley DB supports C, C++, Java, and Perl APIs.
It is used by many applications, including Python and Perl, so this should be installed on all systems.
%package -n %{name}-tools
Summary: Tools for the managing Berkeley DB
Group: System/Libraries
Requires: lib%{name} = %{version}-%{release}
%description -n %{name}-tools
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
This package contains the tools for managing Berkeley DB.
%package -n lib%{name}-devel
Summary: Development files for the Berkeley DB library.
Group: Development/Libraries
Requires: lib%{name} = %{version}-%{release}
%description -n lib%{name}-devel
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
This package contains the header files, libraries, and documentation for building programs which use the Berkeley DB.
%package -n lib%{name}-static
Summary: Static library files for the Berkeley DB library.
Group: Development/Libraries
Requires: lib%{name} = %{version}-%{release}
%description -n lib%{name}-static
The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides embedded database support for both traditional and client/server applications.
This package contains the static library files for the Berkeley DB library.
%package -n lib%{name}-java
Summary: Java bindings for the Berkeley DB library
Group: System/Libraries
Requires: lib%{name} = %{version}-%{release}
%description -n lib%{name}-java
Java bindings for the Berkeley DB library.
%prep
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%setup -q -n db-%{version}
%build
cd build_unix
case "%{_target_cpu}" in
i586) mutex="x86/gcc-assembly" ;;
ppc) mutex="PPC/gcc-assembly" ;;
arm) mutex="ARM/gcc-assembly" ;;
x86_64) mutex="x86_64/gcc-assembly" ;;
*) mutex="UNIX/fcntl" ;;
esac
JAVA_HOME=%{_jvmdir}/jdk/ \
../dist/configure \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--datadir=%{_datadir} \
--includedir=%{_includedir}/%{name} \
--enable-cxx \
--enable-compat185 \
%if "%{stage1}" != "1"
--enable-java \
%endif
--with-mutex="$mutex"
%make
%install
cd build_unix
%makeinstall
# prefix=%{buildroot}%{_prefix} includedir=%{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_datadir}/doc/libdb4-%{version}
mv %{buildroot}%{_prefix}/docs/* \
%{buildroot}%{_datadir}/doc/libdb4-%{version}
rmdir %{buildroot}%{_prefix}/docs
# make this version thre system default
pushd %{buildroot}%{_bindir}
find * -exec ln -s {} {}-%{majvershort} \;
popd
#for f in db.h db_185.h db_cxx.h; do
# ln -s %{name}/$f %{buildroot}%{_includedir}/$f
#done
# fix strange permissions
chmod 755 %{buildroot}%{_bindir}/*
ln -s libdb-%{majver}.so %{buildroot}%{_libdir}/libdb.so.%{majver}
%if "%{stage1}" != "1"
ln -s libdb_java-%{majver}.so %{buildroot}%{_libdir}/libdb_java.so.%{majver}
mkdir -p %{buildroot}%{_datadir}/java
mv %{buildroot}%{_libdir}/*.jar %{buildroot}%{_datadir}/java/
%endif
#rm -f %{buildroot}%{_libdir}/libdb.so
#rm -f %{buildroot}%{_libdir}/libdb_cxx.so
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files -n lib%{name}
%defattr(-,root,root)
%{_libdir}/libdb-%{majver}.so
%{_libdir}/libdb_cxx-%{majver}.so
%{_libdir}/libdb.so.%{majver}
%files -n %{name}-tools
%defattr(-,root,root)
%{_bindir}/*
%files -n lib%{name}-devel
%defattr(-,root,root)
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*
#%{_includedir}/db.h
#%{_includedir}/db_185.h
#%{_includedir}/db_cxx.h
%{_libdir}/*.la
%{_libdir}/libdb-%{MAJver}.so
%{_libdir}/libdb_cxx.so
%{_libdir}/libdb_cxx-%{MAJver}.so
%{_libdir}/libdb.so
%{_docdir}/libdb4-%{version}/*
%files -n lib%{name}-static
%defattr(-,root,root)
%{_libdir}/*.a
%if "%{stage1}" != "1"
%files -n lib%{name}-java
%defattr(-,root,root)
%{_libdir}/libdb_java.so
%{_libdir}/libdb_java-%{MAJver}.so
%{_libdir}/libdb_java-%{majver}.so
%{_libdir}/libdb_java-%{majver}_g.so
%{_libdir}/libdb_java.so.%{majver}
%{_datadir}/java/*.jar
%endif
%changelog
* Wed Dec 20 2017 Automatic Build System <autodist@mambasoft.it> 6.2.32-1mamba
- automatic version update by autodist
* Fri Apr 15 2016 Automatic Build System <autodist@mambasoft.it> 6.2.23-1mamba
- automatic version update by autodist
* Wed Jun 24 2015 Automatic Build System <autodist@mambasoft.it> 6.1.26-1mamba
- automatic version update by autodist
* Mon Apr 27 2015 Automatic Build System <autodist@mambasoft.it> 6.1.23-1mamba
- automatic version update by autodist
* Wed Jul 09 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 6.1.19-2mamba
- rename from db60 to db
* Wed Jul 09 2014 Automatic Build System <autodist@mambasoft.it> 6.1.19-1mamba
- automatic version update by autodist
* Sat Mar 08 2014 Automatic Build System <autodist@mambasoft.it> 6.0.30-1mamba
- automatic version update by autodist
* Tue Jul 09 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 6.0.20-2mamba
- renamed from db53 to db60
* Sun Jul 07 2013 Automatic Build System <autodist@mambasoft.it> 6.0.20-1mamba
- automatic version update by autodist
* Tue Jun 11 2013 Automatic Build System <autodist@mambasoft.it> 6.0.19-1mamba
- automatic version update by autodist
* Tue May 28 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 5.3.21-1mamba
- update to 5.3.21
* Tue Sep 20 2011 Automatic Build System <autodist@mambasoft.it> 5.2.36-1mamba
- automatic version update by autodist
* Wed Aug 31 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 5.2.28-2mamba
- renamed from db51 to db52 using --program-suffix=-52 to keep 5.1 still the default
* Tue Jun 14 2011 Automatic Build System <autodist@mambasoft.it> 5.2.28-1mamba
- automatic update by autodist
* Sat Mar 19 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.25-3mamba
- add libdb.so and libdb_cxx.so symlinks
* Mon Mar 07 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 5.1.25-2mamba
- make this the system default Berkeley DB
* Thu Feb 03 2011 Automatic Build System <autodist@mambasoft.it> 5.1.25-1mamba
- automatic update by autodist
* Fri Sep 10 2010 Automatic Build System <autodist@mambasoft.it> 5.1.19-1mamba
- automatic update to 5.1.19 by autodist
* Fri Jul 02 2010 Automatic Build System <autodist@mambasoft.it> 5.0.26-1mamba
- automatic update to 5.0.26 by autodist
* Sat May 22 2010 Automatic Build System <autodist@mambasoft.it> 5.0.21-1mamba
- automatic update to 5.0.21 by autodist
* Thu Dec 31 2009 Automatic Build System <autodist@mambasoft.it> 4.8.26-1mamba
- automatic update to 4.8.26 by autodist
* Fri Sep 25 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 4.8.24-1mamba
- update to 4.8.24
* Thu Jul 03 2008 gil <puntogil@libero.it> 4.7.25-1mamba
- update to version 4.7.25
- removed patches
* Wed Jun 04 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-8mamba
- specfile updated
* Thu Jul 13 2006 Davide Madrisan <davide.madrisan@qilinux.it> 4.2.52-7qilnx
- fixed openldap warning: "BerkeleyDB 4.2.52 library needs TXN patch!"
- official patches applied
- fixed permissions of binary files
* Wed Oct 26 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-6qilnx
- add OpenOffice patch
* Mon Oct 24 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-5qilnx
- do not link against libpthread
* Mon Oct 24 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-4qilnx
- rebuild with gcj
* Wed Feb 02 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.52-3qilnx
- rebuilt with java bindings
* Tue Jul 27 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.25-8qilnx
- new version build
- source RPM renamed to db42 (should cohexist with libdb4)
* Sun May 09 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-8qilnx
- added libdb.so provides
* Fri May 07 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-7qilnx
- fixed symlinks for compatibility
* Fri May 07 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-6qilnx
- rebuild with --enable-compat185
* Tue Sep 15 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-5qilnx
- Added symlink /usr/include/db.h so that db4 is system default version
* Tue Sep 09 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.25-4qilnx
- Moved includes to /usr/include/db4 for devel packages co-existence
* Fri Jul 25 2003 Silvan Calarco <silvan.calarco@qinet.it> 4.1.25-3qilnx
- Removed compat185 (it looks broken, I'll try to use db2's compat185)
* Thu Jul 24 2003 Silvan Calarco <silvan.calarco@qinet.it> 4.1.25-2qilnx
- Enabled compatibiliy with version 185
* Tue Apr 22 2003 Luca Tinelli <luca.tinelli@qinet.it> 4.1.25-1qilnx
- Creation of db4 package

3533
db4-jni-casting.diff Normal file

File diff suppressed because it is too large Load Diff

248
java.diff Normal file
View File

@ -0,0 +1,248 @@
--- db4-4.2.52/java/src/com/sleepycat/db/DbEnv.java 2003-12-03 16:26:27.000000000 -0500
+++ db4-4.2.52/java/src/com/sleepycat/db/DbEnv.java 2004-03-18 15:15:42.000000000 -0500
@@ -61,7 +61,7 @@
// Internally, the JNI layer creates a global reference to each DbEnv,
// which can potentially be different to this. We keep a copy here so
// we can clean up after destructors.
- private Object dbenv_ref;
+ private long dbenv_ref;
private DbAppDispatch app_dispatch_handler;
private DbEnvFeedbackHandler env_feedback_handler;
private DbErrorHandler error_handler;
@@ -94,7 +94,7 @@
void cleanup() {
swigCPtr = 0;
db_java.deleteRef0(dbenv_ref);
- dbenv_ref = null;
+ dbenv_ref = 0L;
}
--- db4-4.2.52/java/src/com/sleepycat/db/Db.java 2003-12-03 16:26:25.000000000 -0500
+++ db4-4.2.52/java/src/com/sleepycat/db/Db.java 2004-03-18 15:15:55.000000000 -0500
@@ -57,7 +57,7 @@
// Internally, the JNI layer creates a global reference to each Db,
// which can potentially be different to this. We keep a copy here so
// we can clean up after destructors.
- private Object db_ref;
+ private long db_ref;
private DbEnv dbenv;
private boolean private_dbenv;
private DbAppendRecno append_recno_handler;
@@ -84,7 +84,7 @@
private void cleanup() {
swigCPtr = 0;
db_java.deleteRef0(db_ref);
- db_ref = null;
+ db_ref = 0L;
if (private_dbenv) {
dbenv.cleanup();
}
--- db4-4.2.52/java/src/com/sleepycat/db/db_java.java 2003-12-03 16:10:54.000000000 -0500
+++ db4-4.2.52/java/src/com/sleepycat/db/db_java.java 2004-03-18 15:17:24.000000000 -0500
@@ -14,15 +14,15 @@
db_javaJNI.DbEnv_lock_vec(DbEnv.getCPtr(dbenv), locker, flags, list, offset, nlist);
}
- static Object initDbEnvRef0(DbEnv self, Object handle) {
+ static long initDbEnvRef0(DbEnv self, Object handle) {
return db_javaJNI.initDbEnvRef0(DbEnv.getCPtr(self), handle);
}
- static Object initDbRef0(Db self, Object handle) {
+ static long initDbRef0(Db self, Object handle) {
return db_javaJNI.initDbRef0(Db.getCPtr(self), handle);
}
- static void deleteRef0(Object ref) {
+ static void deleteRef0(long ref) {
db_javaJNI.deleteRef0(ref);
}
--- db4-4.2.52/java/src/com/sleepycat/db/db_javaJNI.java 2003-12-03 16:10:55.000000000 -0500
+++ db4-4.2.52/java/src/com/sleepycat/db/db_javaJNI.java 2004-03-18 15:16:18.000000000 -0500
@@ -45,9 +45,9 @@
static native final void initialize();
public final static native void DbEnv_lock_vec(long jarg1, int jarg2, int jarg3, DbLockRequest[] jarg4, int jarg5, int jarg6) throws DbException;
- final static native Object initDbEnvRef0(long jarg1, Object jarg2);
- final static native Object initDbRef0(long jarg1, Object jarg2);
- final static native void deleteRef0(Object jarg1);
+ final static native long initDbEnvRef0(long jarg1, Object jarg2);
+ final static native long initDbRef0(long jarg1, Object jarg2);
+ final static native void deleteRef0(long jarg1);
final static native long getDbEnv0(long jarg1);
public final static native long new_Db(long jarg1, int jarg2) throws DbException;
public final static native void Db_associate(long jarg1, long jarg2, long jarg3, DbSecondaryKeyCreate jarg4, int jarg5) throws DbException;
--- db4-4.2.52/libdb_java/db_java.i 2003-11-17 15:00:52.000000000 -0500
+++ db4-4.2.52/libdb_java/db_java.i 2004-03-18 09:21:14.000000000 -0500
@@ -53,7 +53,7 @@
// Internally, the JNI layer creates a global reference to each DbEnv,
// which can potentially be different to this. We keep a copy here so
// we can clean up after destructors.
- private Object dbenv_ref;
+ private long dbenv_ref;
private DbAppDispatch app_dispatch_handler;
private DbEnvFeedbackHandler env_feedback_handler;
private DbErrorHandler error_handler;
@@ -76,7 +76,7 @@
void cleanup() {
swigCPtr = 0;
db_java.deleteRef0(dbenv_ref);
- dbenv_ref = null;
+ dbenv_ref = 0L;
}
public synchronized void close(int flags) throws DbException {
@@ -220,7 +220,7 @@
// Internally, the JNI layer creates a global reference to each Db,
// which can potentially be different to this. We keep a copy here so
// we can clean up after destructors.
- private Object db_ref;
+ private long db_ref;
private DbEnv dbenv;
private boolean private_dbenv;
private DbAppendRecno append_recno_handler;
@@ -245,7 +245,7 @@
private void cleanup() {
swigCPtr = 0;
db_java.deleteRef0(db_ref);
- db_ref = null;
+ db_ref = 0L;
if (private_dbenv)
dbenv.cleanup();
dbenv = null;
@@ -503,46 +503,42 @@
}
%}
-%native(initDbEnvRef0) jobject initDbEnvRef0(DB_ENV *self, void *handle);
-%native(initDbRef0) jobject initDbRef0(DB *self, void *handle);
-%native(deleteRef0) void deleteRef0(jobject ref);
+%native(initDbEnvRef0) jlong initDbEnvRef0(DB_ENV *self, void *handle);
+%native(initDbRef0) jlong initDbRef0(DB *self, void *handle);
+%native(deleteRef0) void deleteRef0(jlong ref);
%native(getDbEnv0) DB_ENV *getDbEnv0(DB *self);
%{
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
+JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
DB_ENV *self = *(DB_ENV **)&jarg1;
+ jlong ret;
COMPQUIET(jcls, NULL);
DB_ENV_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
self->set_errpfx(self, (const char*)self);
- return (jobject)DB_ENV_INTERNAL(self);
+ *(jobject *)&ret = (jobject)DB_ENV_INTERNAL(self);
+ return (ret);
}
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
+JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
DB *self = *(DB **)&jarg1;
+ jlong ret;
COMPQUIET(jcls, NULL);
DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
- return (jobject)DB_INTERNAL(self);
+ *(jobject *)&ret = (jobject)DB_INTERNAL(self);
+ return (ret);
}
JNIEXPORT void JNICALL Java_com_sleepycat_db_db_1javaJNI_deleteRef0(
- JNIEnv *jenv, jclass jcls, jobject jref) {
- COMPQUIET(jcls, NULL);
-
- if (jref != NULL)
- (*jenv)->DeleteGlobalRef(jenv, jref);
-}
-
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1) {
- DB *self = *(DB **)&jarg1;
+ jobject jref = *(jobject *)&jarg1;
COMPQUIET(jcls, NULL);
- COMPQUIET(jenv, NULL);
- return (jobject)DB_INTERNAL(self);
+ if (jref != 0L)
+ (*jenv)->DeleteGlobalRef(jenv, jref);
}
JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
@@ -554,7 +550,7 @@
COMPQUIET(jcls, NULL);
*(DB_ENV **)&env_cptr = self->dbenv;
- return env_cptr;
+ return (env_cptr);
}
JNIEXPORT jboolean JNICALL
--- db4-4.2.52/libdb_java/db_java_wrap.c 2003-12-03 16:10:36.000000000 -0500
+++ db4-4.2.52/libdb_java/db_java_wrap.c 2004-03-18 12:18:58.000000000 -0500
@@ -1192,40 +1192,36 @@
}
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
+JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
DB_ENV *self = *(DB_ENV **)&jarg1;
+ jlong ret;
COMPQUIET(jcls, NULL);
DB_ENV_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
self->set_errpfx(self, (const char*)self);
- return (jobject)DB_ENV_INTERNAL(self);
+ *(jobject *)&ret = (jobject)DB_ENV_INTERNAL(self);
+ return (ret);
}
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
+JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
DB *self = *(DB **)&jarg1;
+ jlong ret;
COMPQUIET(jcls, NULL);
DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
- return (jobject)DB_INTERNAL(self);
+ *(jobject *)&ret = (jobject)DB_INTERNAL(self);
+ return (ret);
}
JNIEXPORT void JNICALL Java_com_sleepycat_db_db_1javaJNI_deleteRef0(
- JNIEnv *jenv, jclass jcls, jobject jref) {
- COMPQUIET(jcls, NULL);
-
- if (jref != NULL)
- (*jenv)->DeleteGlobalRef(jenv, jref);
-}
-
-JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbRef0(
JNIEnv *jenv, jclass jcls, jlong jarg1) {
- DB *self = *(DB **)&jarg1;
+ jobject jref = *(jobject *)&jarg1;
COMPQUIET(jcls, NULL);
- COMPQUIET(jenv, NULL);
- return (jobject)DB_INTERNAL(self);
+ if (jref != 0L)
+ (*jenv)->DeleteGlobalRef(jenv, jref);
}
JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
@@ -1237,7 +1233,7 @@
COMPQUIET(jcls, NULL);
*(DB_ENV **)&env_cptr = self->dbenv;
- return env_cptr;
+ return (env_cptr);
}
JNIEXPORT jboolean JNICALL