--- berkeleydb/db-4.2.52.patch.miscdb42	2006-01-29 14:56:41.000000000 +0100
+++ berkeleydb/db-4.2.52.patch	2006-01-29 20:30:23.000000000 +0100
@@ -4476,3 +4476,4469 @@
 ! 			$(SLO)$/xa_map.obj
 ! 
 ! .INCLUDE :  target.mk
+diff -cNr misc/build/db-4.2.52.NC.orig/btree/bt_rec.c misc/build/db-4.2.52.NC/btree/bt_rec.c
+*** misc/build/db-4.2.52.NC.orig/btree/bt_rec.c	2003-09-13 20:48:58.000000000 +0200
+--- misc/build/db-4.2.52.NC/btree/bt_rec.c	2006-01-29 14:18:19.000000000 +0100
+***************
+*** 222,228 ****
+  		 * 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 ((ret =
+  			    __memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
+  				ret = __db_pgerr(file_dbp, argp->npgno, ret);
+--- 222,228 ----
+  		 * previous-page pointer updated to our new page.  The next
+  		 * page must exist because we're redoing the operation.
+  		 */
+! 		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,300 ****
+  		 * 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 ((ret =
+  			    __memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
+  				np = NULL;
+--- 294,300 ----
+  		 * possible that the next-page never existed, we ignore it as
+  		 * if there's nothing to undo.
+  		 */
+! 		if (!rootsplit && argp->npgno != PGNO_INVALID) {
+  			if ((ret =
+  			    __memp_fget(mpf, &argp->npgno, 0, &np)) != 0) {
+  				np = NULL;
+diff -cNr misc/build/db-4.2.52.NC.orig/dbinc/db.in misc/build/db-4.2.52.NC/dbinc/db.in
+*** misc/build/db-4.2.52.NC.orig/dbinc/db.in	2003-10-03 19:20:36.000000000 +0200
+--- misc/build/db-4.2.52.NC/dbinc/db.in	2006-01-29 14:50:27.000000000 +0100
+***************
+*** 839,844 ****
+--- 839,845 ----
+  #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;
+  };
+  
+diff -cNr misc/build/db-4.2.52.NC.orig/dbinc/mutex.h misc/build/db-4.2.52.NC/dbinc/mutex.h
+*** misc/build/db-4.2.52.NC.orig/dbinc/mutex.h	2003-09-20 23:40:49.000000000 +0200
+--- misc/build/db-4.2.52.NC/dbinc/mutex.h	2006-01-29 14:47:26.000000000 +0100
+***************
+*** 781,786 ****
+--- 781,811 ----
+  #endif
+  #endif
+  
++ /*********************************************************************
++  * amd64/gcc assembly.
++  *********************************************************************/
++ #ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
++ typedef unsigned char tsl_t;
++ 
++ #ifdef LOAD_ACTUAL_MUTEX_CODE
++ /*
++  * For gcc/amd64, 0 is clear, 1 is set.
++  */
++ #define  MUTEX_SET(tsl) ({           \
++ 	register tsl_t *__l = (tsl);          \
++ 	int __r;              \
++ 	asm volatile("mov $1,%%rax; lock; xchgb %1,%%al; xor $1,%%rax"\
++ 		: "=&a" (__r), "=m" (*__l)          \
++ 		: "1" (*__l)            \
++ 		);                \
++ 	__r & 1;              \
++ })
++ 
++ #define  MUTEX_UNSET(tsl)  (*(tsl) = 0)
++ #define  MUTEX_INIT(tsl)   MUTEX_UNSET(tsl)
++ #endif
++ #endif
++ 
+  /*
+   * Mutex alignment defaults to one byte.
+   *
+diff -cNr misc/build/db-4.2.52.NC.orig/dist/aclocal/libtool.ac misc/build/db-4.2.52.NC/dist/aclocal/libtool.ac
+*** misc/build/db-4.2.52.NC.orig/dist/aclocal/libtool.ac	2003-04-26 19:45:37.000000000 +0200
+--- misc/build/db-4.2.52.NC/dist/aclocal/libtool.ac	2006-01-29 14:48:40.000000000 +0100
+***************
+*** 1092,1097 ****
+--- 1092,1120 ----
+  version_type=none
+  dynamic_linker="$host_os ld.so"
+  sys_lib_dlsearch_path_spec="/lib /usr/lib"
++ 
++ case $host in
++ *-*-linux*)
++   # Test if the compiler is 64bit
++   echo 'int i;' > conftest.$ac_ext
++   lt_cv_cc_64bit_output=no
++   if AC_TRY_EVAL(ac_compile); then
++     case "`/usr/bin/file conftest.$ac_objext`" in
++     *64-bit*)
++       lt_cv_cc_64bit_output=yes
++       ;;
++     esac
++   fi
++   rm -rf conftest*
++   ;;
++ esac
++ 
++ case $host_cpu:$lt_cv_cc_64bit_output in
++ powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
++   sys_lib_dlsearch_path_spec="/lib64 /usr/lib64"
++   ;;
++ esac
++ 
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+    if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+***************
+*** 2019,2025 ****
+  [AC_REQUIRE([AC_PROG_EGREP])dnl
+  AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+  [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+! case `"$LD" -v 2>&1 </dev/null` in
+  *GNU* | *'with BFD'*)
+    lt_cv_prog_gnu_ld=yes
+    ;;
+--- 2042,2048 ----
+  [AC_REQUIRE([AC_PROG_EGREP])dnl
+  AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+  [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+! case `$LD -v 2>&1 </dev/null` in
+  *GNU* | *'with BFD'*)
+    lt_cv_prog_gnu_ld=yes
+    ;;
+***************
+*** 2167,2173 ****
+  # This must be Linux ELF.
+  linux*)
+    case $host_cpu in
+!   alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*)
+      lt_cv_deplibs_check_method=pass_all ;;
+    *)
+      # glibc up to 2.1.1 does not perform some relocations on ARM
+--- 2190,2196 ----
+  # This must be Linux ELF.
+  linux*)
+    case $host_cpu in
+!   alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh* | x86_64*)
+      lt_cv_deplibs_check_method=pass_all ;;
+    *)
+      # glibc up to 2.1.1 does not perform some relocations on ARM
+diff -cNr misc/build/db-4.2.52.NC.orig/dist/aclocal/mutex.ac misc/build/db-4.2.52.NC/dist/aclocal/mutex.ac
+*** misc/build/db-4.2.52.NC.orig/dist/aclocal/mutex.ac	2003-06-16 16:54:39.000000000 +0200
+--- misc/build/db-4.2.52.NC/dist/aclocal/mutex.ac	2006-01-29 14:47:26.000000000 +0100
+***************
+*** 198,225 ****
+  # Try with and without the -lpthread library.  If the user specified we use
+  # POSIX pthreads mutexes, and we fail to find the full interface, try and
+  # configure for just intra-process support.
+! if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then
+! 	AM_PTHREADS_SHARED("POSIX/pthreads")
+! fi
+! if test "$db_cv_mutex" = no -o \
+!     "$db_cv_mutex" = "posix_only" -o "$db_cv_mutex" = "posix_library_only"; then
+! 	LIBS="$LIBS -lpthread"
+! 	AM_PTHREADS_SHARED("POSIX/pthreads/library")
+! 	LIBS="$orig_libs"
+! fi
+! if test "$db_cv_mutex" = "posix_only"; then
+! 	AM_PTHREADS_PRIVATE("POSIX/pthreads/private")
+! fi
+! if test "$db_cv_mutex" = "posix_only" -o \
+!     "$db_cv_mutex" = "posix_library_only"; then
+! 	LIBS="$LIBS -lpthread"
+! 	AM_PTHREADS_PRIVATE("POSIX/pthreads/library/private")
+! 	LIBS="$orig_libs"
+! fi
+! 
+! if test "$db_cv_mutex" = "posix_only" -o \
+!     "$db_cv_mutex" = "posix_library_only"; then
+! 	AC_MSG_ERROR([unable to find POSIX 1003.1 mutex interfaces])
+  fi
+  
+  # msemaphore: HPPA only
+--- 198,228 ----
+  # Try with and without the -lpthread library.  If the user specified we use
+  # POSIX pthreads mutexes, and we fail to find the full interface, try and
+  # configure for just intra-process support.
+! if test "$db_cv_pthreadsmutexes" = yes; then
+! 	if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then
+! 		AM_PTHREADS_SHARED("POSIX/pthreads")
+! 	fi
+! 	if test "$db_cv_mutex" = no -o \
+! 	    "$db_cv_mutex" = "posix_only" -o \
+! 	    "$db_cv_mutex" = "posix_library_only"; then
+! 		LIBS="$LIBS -lpthread"
+! 		AM_PTHREADS_SHARED("POSIX/pthreads/library")
+! 		LIBS="$orig_libs"
+! 	fi
+! 	if test "$db_cv_mutex" = "posix_only"; then
+! 		AM_PTHREADS_PRIVATE("POSIX/pthreads/private")
+! 	fi
+! 	if test "$db_cv_mutex" = "posix_only" -o \
+! 	    "$db_cv_mutex" = "posix_library_only"; then
+! 		LIBS="$LIBS -lpthread"
+! 		AM_PTHREADS_PRIVATE("POSIX/pthreads/library/private")
+! 		LIBS="$orig_libs"
+! 	fi
+! 
+! 	if test "$db_cv_mutex" = "posix_only" -o \
+! 	    "$db_cv_mutex" = "posix_library_only"; then
+! 		AC_MSG_ERROR([unable to find POSIX 1003.1 mutex interfaces])
+! 	fi
+  fi
+  
+  # msemaphore: HPPA only
+***************
+*** 450,455 ****
+--- 453,469 ----
+  ], [db_cv_mutex="S390/gcc-assembly"])
+  fi
+  
++ # AMD64/gcc: FreeBSD, NetBSD, BSD/OS, Linux
++ if test "$db_cv_mutex" = no; then
++ AC_TRY_COMPILE(,[
++ #if (defined(x86_64) || defined(__x86_64__)) && defined(__GNUC__)
++ 	exit(0);
++ #else
++ 	FAIL TO COMPILE/LINK
++ #endif
++ ], [db_cv_mutex="x86_64/gcc-assembly"])
++ fi
++ 
+  # ia86/gcc: Linux
+  if test "$db_cv_mutex" = no; then
+  AC_TRY_COMPILE(,[
+***************
+*** 610,615 ****
+--- 624,633 ----
+  			AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY)
+  			AH_TEMPLATE(HAVE_MUTEX_X86_GCC_ASSEMBLY,
+  			    [Define to 1 to use the GCC compiler and x86 assembly language mutexes.]);;
++ x86_64/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
++ 			AC_DEFINE(HAVE_MUTEX_X86_64_GCC_ASSEMBLY)
++ 			AH_TEMPLATE(HAVE_MUTEX_X86_64_GCC_ASSEMBLY,
++ 			    [Define to 1 to use the GCC compiler and amd64 assembly language mutexes.]);;
+  UNIX/fcntl)		AC_MSG_WARN(
+  			    [NO FAST MUTEXES FOUND FOR THIS COMPILER/ARCHITECTURE.])
+  			ADDITIONAL_OBJS="mut_fcntl${o} $ADDITIONAL_OBJS"
+diff -cNr misc/build/db-4.2.52.NC.orig/dist/aclocal/options.ac misc/build/db-4.2.52.NC/dist/aclocal/options.ac
+*** misc/build/db-4.2.52.NC.orig/dist/aclocal/options.ac	2003-11-17 20:58:48.000000000 +0100
+--- misc/build/db-4.2.52.NC/dist/aclocal/options.ac	2006-01-29 14:46:48.000000000 +0100
+***************
+*** 137,142 ****
+--- 137,152 ----
+  	[db_cv_mingw="$enable_mingw"], [db_cv_mingw="no"])
+  AC_MSG_RESULT($db_cv_mingw)
+  
++ AC_MSG_CHECKING(if --disable-pthreadsmutexes option specified)
++ AC_ARG_ENABLE(pthreadsmutexes,
++ 	AC_HELP_STRING([--disable-pthreadsmutexes],
++ 	    [Do not use POSIX pthreads mutexes.]),, enableval="yes")
++ db_cv_pthreadsmutexes="$enableval"
++ case "$enableval" in
++  no) AC_MSG_RESULT(yes);;
++ yes) AC_MSG_RESULT(no);;
++ esac
++ 
+  AC_MSG_CHECKING(if --enable-posixmutexes option specified)
+  AC_ARG_ENABLE(posixmutexes,
+  	[AC_HELP_STRING([--enable-posixmutexes],
+diff -cNr misc/build/db-4.2.52.NC.orig/dist/configure.ac misc/build/db-4.2.52.NC/dist/configure.ac
+*** misc/build/db-4.2.52.NC.orig/dist/configure.ac	2003-10-15 02:55:17.000000000 +0200
+--- misc/build/db-4.2.52.NC/dist/configure.ac	2006-01-29 14:51:30.000000000 +0100
+***************
+*** 405,414 ****
+--- 405,424 ----
+  		AC_MSG_ERROR([Java version 1.3 or higher required, got $JAVA_VERSION]) ;;
+  	esac
+  
++ 	dnl check for libgcj includes
++ 	if test -z "$PKG_CONFIG"; then
++ 		AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
++ 	fi
++ 	if test -z "$JNI_INCLUDE_DIRS"; then
++ 		if $PKG_CONFIG --exists libgcj ; then
++ 			CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags libgcj`"
++ 		fi
++ 	else
+  	for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
+  	do
+  		CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
+  	done
++ 	fi
+  
+  	ADDITIONAL_LANG="$ADDITIONAL_LANG java"
+  	INSTALL_LIBS="$INSTALL_LIBS \$(libjso_target)"
+diff -cNr misc/build/db-4.2.52.NC.orig/dist/Makefile.in misc/build/db-4.2.52.NC/dist/Makefile.in
+*** misc/build/db-4.2.52.NC.orig/dist/Makefile.in	2003-11-28 19:50:06.000000000 +0100
+--- misc/build/db-4.2.52.NC/dist/Makefile.in	2006-01-29 14:47:45.000000000 +0100
+***************
+*** 143,150 ****
+  # local libraries, for example.  Do that by adding -I options to the DB185INC
+  # line, and -l options to the DB185LIB line.
+  ##################################################
+! DB185INC=	-c @CFLAGS@ -I$(srcdir) @CPPFLAGS@
+! DB185LIB=
+  
+  ##################################################
+  # NOTHING BELOW THIS LINE SHOULD EVER NEED TO BE MODIFIED.
+--- 143,150 ----
+  # local libraries, for example.  Do that by adding -I options to the DB185INC
+  # line, and -l options to the DB185LIB line.
+  ##################################################
+! DB185INC=	-c @CFLAGS@ -I/usr/include/db1 -I$(srcdir) @CPPFLAGS@
+! DB185LIB=	-Wl,-static,-ldb1,-Bdynamic
+  
+  ##################################################
+  # NOTHING BELOW THIS LINE SHOULD EVER NEED TO BE MODIFIED.
+diff -cNr misc/build/db-4.2.52.NC.orig/java/src/com/sleepycat/db/DbEnv.java misc/build/db-4.2.52.NC/java/src/com/sleepycat/db/DbEnv.java
+*** misc/build/db-4.2.52.NC.orig/java/src/com/sleepycat/db/DbEnv.java	2003-12-03 22:26:27.000000000 +0100
+--- misc/build/db-4.2.52.NC/java/src/com/sleepycat/db/DbEnv.java	2006-01-29 14:18:11.000000000 +0100
+***************
+*** 61,67 ****
+      // 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 DbAppDispatch app_dispatch_handler;
+      private DbEnvFeedbackHandler env_feedback_handler;
+      private DbErrorHandler error_handler;
+--- 61,67 ----
+      // 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 long dbenv_ref;
+      private DbAppDispatch app_dispatch_handler;
+      private DbEnvFeedbackHandler env_feedback_handler;
+      private DbErrorHandler error_handler;
+***************
+*** 94,100 ****
+      void cleanup() {
+          swigCPtr = 0;
+          db_java.deleteRef0(dbenv_ref);
+!         dbenv_ref = null;
+      }
+  
+  
+--- 94,100 ----
+      void cleanup() {
+          swigCPtr = 0;
+          db_java.deleteRef0(dbenv_ref);
+!         dbenv_ref = 0L;
+      }
+  
+  
+diff -cNr misc/build/db-4.2.52.NC.orig/java/src/com/sleepycat/db/Db.java misc/build/db-4.2.52.NC/java/src/com/sleepycat/db/Db.java
+*** misc/build/db-4.2.52.NC.orig/java/src/com/sleepycat/db/Db.java	2003-12-03 22:26:25.000000000 +0100
+--- misc/build/db-4.2.52.NC/java/src/com/sleepycat/db/Db.java	2006-01-29 14:18:11.000000000 +0100
+***************
+*** 57,63 ****
+      // 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 DbEnv dbenv;
+      private boolean private_dbenv;
+      private DbAppendRecno append_recno_handler;
+--- 57,63 ----
+      // 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 long db_ref;
+      private DbEnv dbenv;
+      private boolean private_dbenv;
+      private DbAppendRecno append_recno_handler;
+***************
+*** 84,90 ****
+      private void cleanup() {
+          swigCPtr = 0;
+          db_java.deleteRef0(db_ref);
+!         db_ref = null;
+          if (private_dbenv) {
+              dbenv.cleanup();
+          }
+--- 84,90 ----
+      private void cleanup() {
+          swigCPtr = 0;
+          db_java.deleteRef0(db_ref);
+!         db_ref = 0L;
+          if (private_dbenv) {
+              dbenv.cleanup();
+          }
+diff -cNr misc/build/db-4.2.52.NC.orig/java/src/com/sleepycat/db/db_java.java misc/build/db-4.2.52.NC/java/src/com/sleepycat/db/db_java.java
+*** misc/build/db-4.2.52.NC.orig/java/src/com/sleepycat/db/db_java.java	2003-12-03 22:10:54.000000000 +0100
+--- misc/build/db-4.2.52.NC/java/src/com/sleepycat/db/db_java.java	2006-01-29 14:18:11.000000000 +0100
+***************
+*** 14,28 ****
+      db_javaJNI.DbEnv_lock_vec(DbEnv.getCPtr(dbenv), locker, flags, list, offset, nlist);
+    }
+  
+!    static Object initDbEnvRef0(DbEnv self, Object handle) {
+      return db_javaJNI.initDbEnvRef0(DbEnv.getCPtr(self), handle);
+    }
+  
+!    static Object initDbRef0(Db self, Object handle) {
+      return db_javaJNI.initDbRef0(Db.getCPtr(self), handle);
+    }
+  
+!    static void deleteRef0(Object ref) {
+      db_javaJNI.deleteRef0(ref);
+    }
+  
+--- 14,28 ----
+      db_javaJNI.DbEnv_lock_vec(DbEnv.getCPtr(dbenv), locker, flags, list, offset, nlist);
+    }
+  
+!    static long initDbEnvRef0(DbEnv self, Object handle) {
+      return db_javaJNI.initDbEnvRef0(DbEnv.getCPtr(self), handle);
+    }
+  
+!    static long initDbRef0(Db self, Object handle) {
+      return db_javaJNI.initDbRef0(Db.getCPtr(self), handle);
+    }
+  
+!    static void deleteRef0(long ref) {
+      db_javaJNI.deleteRef0(ref);
+    }
+  
+diff -cNr misc/build/db-4.2.52.NC.orig/java/src/com/sleepycat/db/db_javaJNI.java misc/build/db-4.2.52.NC/java/src/com/sleepycat/db/db_javaJNI.java
+*** misc/build/db-4.2.52.NC.orig/java/src/com/sleepycat/db/db_javaJNI.java	2003-12-03 22:10:55.000000000 +0100
+--- misc/build/db-4.2.52.NC/java/src/com/sleepycat/db/db_javaJNI.java	2006-01-29 14:18:11.000000000 +0100
+***************
+*** 45,53 ****
+  	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 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;
+--- 45,53 ----
+  	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 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;
+diff -cNr misc/build/db-4.2.52.NC.orig/libdb_java/db_java.i misc/build/db-4.2.52.NC/libdb_java/db_java.i
+*** misc/build/db-4.2.52.NC.orig/libdb_java/db_java.i	2003-11-17 21:00:52.000000000 +0100
+--- misc/build/db-4.2.52.NC/libdb_java/db_java.i	2006-01-29 14:18:11.000000000 +0100
+***************
+*** 53,59 ****
+  	// 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 DbAppDispatch app_dispatch_handler;
+  	private DbEnvFeedbackHandler env_feedback_handler;
+  	private DbErrorHandler error_handler;
+--- 53,59 ----
+  	// 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 long dbenv_ref;
+  	private DbAppDispatch app_dispatch_handler;
+  	private DbEnvFeedbackHandler env_feedback_handler;
+  	private DbErrorHandler error_handler;
+***************
+*** 76,82 ****
+  	void cleanup() {
+  		swigCPtr = 0;
+  		db_java.deleteRef0(dbenv_ref);
+! 		dbenv_ref = null;
+  	}
+  
+  	public synchronized void close(int flags) throws DbException {
+--- 76,82 ----
+  	void cleanup() {
+  		swigCPtr = 0;
+  		db_java.deleteRef0(dbenv_ref);
+! 		dbenv_ref = 0L;
+  	}
+  
+  	public synchronized void close(int flags) throws DbException {
+***************
+*** 220,226 ****
+  	// 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 DbEnv dbenv;
+  	private boolean private_dbenv;
+  	private DbAppendRecno append_recno_handler;
+--- 220,226 ----
+  	// 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 long db_ref;
+  	private DbEnv dbenv;
+  	private boolean private_dbenv;
+  	private DbAppendRecno append_recno_handler;
+***************
+*** 245,251 ****
+  	private void cleanup() {
+  		swigCPtr = 0;
+  		db_java.deleteRef0(db_ref);
+! 		db_ref = null;
+  		if (private_dbenv)
+  			dbenv.cleanup();
+  		dbenv = null;
+--- 245,251 ----
+  	private void cleanup() {
+  		swigCPtr = 0;
+  		db_java.deleteRef0(db_ref);
+! 		db_ref = 0L;
+  		if (private_dbenv)
+  			dbenv.cleanup();
+  		dbenv = null;
+***************
+*** 503,548 ****
+  	}
+  %}
+  
+! %native(initDbEnvRef0) jobject initDbEnvRef0(DB_ENV *self, void *handle);
+! %native(initDbRef0) jobject initDbRef0(DB *self, void *handle);
+! %native(deleteRef0) void deleteRef0(jobject ref);
+  %native(getDbEnv0) DB_ENV *getDbEnv0(DB *self);
+  
+  %{
+! JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
+      JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
+  	DB_ENV *self = *(DB_ENV **)&jarg1;
+  	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);
+  }
+  
+! JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
+      JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
+  	DB *self = *(DB **)&jarg1;
+  	COMPQUIET(jcls, NULL);
+  
+  	DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
+! 	return (jobject)DB_INTERNAL(self);
+  }
+  
+  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;
+  	COMPQUIET(jcls, NULL);
+- 	COMPQUIET(jenv, NULL);
+  
+! 	return (jobject)DB_INTERNAL(self);
+  }
+  
+  JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
+--- 503,544 ----
+  	}
+  %}
+  
+! %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 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);
+! 	*(jobject *)&ret = (jobject)DB_ENV_INTERNAL(self);
+! 	return (ret);
+  }
+  
+! 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);
+! 	*(jobject *)&ret = (jobject)DB_INTERNAL(self);
+! 	return (ret);
+  }
+  
+  JNIEXPORT void JNICALL Java_com_sleepycat_db_db_1javaJNI_deleteRef0(
+      JNIEnv *jenv, jclass jcls, jlong jarg1) {
+! 	jobject jref = *(jobject *)&jarg1;
+  	COMPQUIET(jcls, NULL);
+  
+! 	if (jref != 0L)
+! 		(*jenv)->DeleteGlobalRef(jenv, jref);
+  }
+  
+  JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
+***************
+*** 554,560 ****
+  	COMPQUIET(jcls, NULL);
+  
+  	*(DB_ENV **)&env_cptr = self->dbenv;
+! 	return env_cptr;
+  }
+  
+  JNIEXPORT jboolean JNICALL
+--- 550,556 ----
+  	COMPQUIET(jcls, NULL);
+  
+  	*(DB_ENV **)&env_cptr = self->dbenv;
+! 	return (env_cptr);
+  }
+  
+  JNIEXPORT jboolean JNICALL
+diff -cNr misc/build/db-4.2.52.NC.orig/libdb_java/db_java_wrap.c misc/build/db-4.2.52.NC/libdb_java/db_java_wrap.c
+*** misc/build/db-4.2.52.NC.orig/libdb_java/db_java_wrap.c	2006-01-29 14:10:09.000000000 +0100
+--- misc/build/db-4.2.52.NC/libdb_java/db_java_wrap.c	2006-01-29 14:43:29.000000000 +0100
+***************
+*** 371,378 ****
+  	memset(lsn_copy, 0, sizeof(DB_LSN));
+  	*lsn_copy = *lsn;
+  	/* Magic to convert a pointer to a long - must match SWIG */
+! 	jptr = (intptr_t) lsn_copy;
+! /*	*(DB_LSN **)&jptr = lsn_copy; */
+  	return (*jenv)->NewObject(jenv, dblsn_class, dblsn_construct,
+  	    jptr, JNI_TRUE);
+  }
+--- 371,377 ----
+  	memset(lsn_copy, 0, sizeof(DB_LSN));
+  	*lsn_copy = *lsn;
+  	/* Magic to convert a pointer to a long - must match SWIG */
+! 	*(DB_LSN **)&jptr = lsn_copy;
+  	return (*jenv)->NewObject(jenv, dblsn_class, dblsn_construct,
+  	    jptr, JNI_TRUE);
+  }
+***************
+*** 633,640 ****
+  	int completed;
+  
+  	COMPQUIET(jcls, NULL);
+! 	dbenv = (DB_ENV *)((intptr_t)jdbenvp);
+! /*	dbenv = *(DB_ENV **)&jdbenvp; */
+  	jdbenv = (jobject)DB_ENV_INTERNAL(dbenv);
+  
+  	if (dbenv == NULL) {
+--- 632,638 ----
+  	int completed;
+  
+  	COMPQUIET(jcls, NULL);
+! 	dbenv = *(DB_ENV **)&jdbenvp;
+  	jdbenv = (jobject)DB_ENV_INTERNAL(dbenv);
+  
+  	if (dbenv == NULL) {
+***************
+*** 703,710 ****
+  				    "DbLockRequest lock field is NULL", NULL, jdbenv);
+  				goto out2;
+  			}
+! 			lockp = (DB_LOCK *)((intptr_t)jlockp);
+! /*			lockp = *(DB_LOCK **)&jlockp; */
+  			prereq->lock = *lockp;
+  			break;
+  		case DB_LOCK_PUT_ALL:
+--- 701,707 ----
+  				    "DbLockRequest lock field is NULL", NULL, jdbenv);
+  				goto out2;
+  			}
+! 			lockp = *(DB_LOCK **)&jlockp;
+  			prereq->lock = *lockp;
+  			break;
+  		case DB_LOCK_PUT_ALL:
+***************
+*** 748,755 ****
+  			    lockreq_lock_fid);
+  			jlockp = (*jenv)->GetLongField(jenv, jlock,
+  			    lock_cptr_fid);
+! 			lockp = (DB_LOCK *)((intptr_t)jlockp);
+! /*			lockp = *(DB_LOCK **)&jlockp; */
+  			__os_free(NULL, lockp);
+  			(*jenv)->SetLongField(jenv, jlock, lock_cptr_fid,
+  			    (jlong)0);
+--- 745,751 ----
+  			    lockreq_lock_fid);
+  			jlockp = (*jenv)->GetLongField(jenv, jlock,
+  			    lock_cptr_fid);
+! 			lockp = *(DB_LOCK **)&jlockp;
+  			__os_free(NULL, lockp);
+  			(*jenv)->SetLongField(jenv, jlock, lock_cptr_fid,
+  			    (jlong)0);
+***************
+*** 767,774 ****
+  			}
+  
+  			*lockp = lockreq[i].lock;
+! 			jlockp = (intptr_t)lockp;
+! /*			*(DB_LOCK **)&jlockp = lockp; */
+  
+  			jlockreq = (*jenv)->GetObjectArrayElement(jenv,
+  			    list, i + offset);
+--- 763,769 ----
+  			}
+  
+  			*lockp = lockreq[i].lock;
+! 			*(DB_LOCK **)&jlockp = lockp;
+  
+  			jlockreq = (*jenv)->GetObjectArrayElement(jenv,
+  			    list, i + offset);
+***************
+*** 1197,1253 ****
+  }
+  
+  
+! JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
+      JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
+! 	DB_ENV *self = (DB_ENV *)((intptr_t)jarg1);
+! /*	DB_ENV *self = *(DB_ENV **)&jarg1; */
+  	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);
+  }
+  
+! JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
+      JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
+! 	DB *self = (DB *)((intptr_t)jarg1);
+! /*	DB *self = *(DB **)&jarg1; */
+  	COMPQUIET(jcls, NULL);
+  
+  	DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
+! 	return (jobject)DB_INTERNAL(self);
+  }
+  
+  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 *)((intptr_t)jarg1);
+! /*	DB *self = *(DB **)&jarg1; */
+  	COMPQUIET(jcls, NULL);
+- 	COMPQUIET(jenv, NULL);
+  
+! 	return (jobject)DB_INTERNAL(self);
+  }
+  
+  JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
+      JNIEnv *jenv, jclass jcls, jlong jarg1) {
+! 	DB *self = (DB *)((intptr_t)jarg1);
+! /*	DB *self = *(DB **)&jarg1; */
+  	jlong env_cptr;
+  
+  	COMPQUIET(jenv, NULL);
+  	COMPQUIET(jcls, NULL);
+  
+! 	env_cptr = (jlong)((intptr_t)(self->dbenv));
+! /*	*(DB_ENV **)&env_cptr = self->dbenv; */
+! 	return env_cptr;
+  }
+  
+  JNIEXPORT jboolean JNICALL
+--- 1192,1239 ----
+  }
+  
+  
+! 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);
+! 	*(jobject *)&ret = (jobject)DB_ENV_INTERNAL(self);
+! 	return (ret);
+  }
+  
+! 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);
+! 	*(jobject *)&ret = (jobject)DB_INTERNAL(self);
+! 	return (ret);
+  }
+  
+  JNIEXPORT void JNICALL Java_com_sleepycat_db_db_1javaJNI_deleteRef0(
+      JNIEnv *jenv, jclass jcls, jlong jarg1) {
+! 	jobject jref = *(jobject *)&jarg1;
+  	COMPQUIET(jcls, NULL);
+  
+! 	if (jref != 0L)
+! 		(*jenv)->DeleteGlobalRef(jenv, jref);
+  }
+  
+  JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
+      JNIEnv *jenv, jclass jcls, jlong jarg1) {
+! 	DB *self = *(DB **)&jarg1;
+  	jlong env_cptr;
+  
+  	COMPQUIET(jenv, NULL);
+  	COMPQUIET(jcls, NULL);
+  
+! 	*(DB_ENV **)&env_cptr = self->dbenv;
+! 	return (env_cptr);
+  }
+  
+  JNIEXPORT jboolean JNICALL
+***************
+*** 2007,2014 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (DB_ENV *)((intptr_t)jarg1);
+! /*    arg1 = *(DB_ENV **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      errno = 0;
+--- 1993,1999 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(DB_ENV **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      errno = 0;
+***************
+*** 2017,2024 ****
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(struct __db **)&jresult = result; */
+      return jresult;
+  }
+  
+--- 2002,2008 ----
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
+      
+!     *(struct __db **)&jresult = result; 
+      return jresult;
+  }
+  
+***************
+*** 2033,2044 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+!     arg3 = (DB *)((intptr_t)jarg3);
+! /*    arg3 = *(DB **)&jarg3; */
+      
+      arg4 = (jarg4 == NULL) ? NULL : __dbj_seckey_create;
+      
+--- 2017,2025 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+!     arg3 = *(DB **)&jarg3; 
+      
+      arg4 = (jarg4 == NULL) ? NULL : __dbj_seckey_create;
+      
+***************
+*** 2066,2073 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 2047,2053 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 2096,2105 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      arg3 = (u_int32_t)jarg3; 
+      
+      if (jarg1 == 0) {
+--- 2076,2083 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+      if (jarg1 == 0) {
+***************
+*** 2114,2121 ****
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(DBC **)&jresult = result; */
+      return jresult;
+  }
+  
+--- 2092,2098 ----
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
+      
+!     *(DBC **)&jresult = result; 
+      return jresult;
+  }
+  
+***************
+*** 2131,2140 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+--- 2108,2115 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+***************
+*** 2168,2175 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (int)jarg2; 
+      {
+          arg3 = 0;
+--- 2143,2149 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (int)jarg2; 
+      {
+          arg3 = 0;
+***************
+*** 2198,2205 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 2172,2178 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 2234,2243 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+--- 2207,2214 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+***************
+*** 2279,2286 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2250,2256 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2308,2315 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2278,2284 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2335,2342 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2304,2310 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2362,2369 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2330,2336 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2391,2398 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2358,2364 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2420,2427 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2386,2392 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2447,2454 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2412,2418 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2474,2481 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2438,2444 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2501,2508 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2464,2470 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2516,2523 ****
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(DB_MPOOLFILE **)&jresult = result; */
+      return jresult;
+  }
+  
+--- 2478,2484 ----
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
+      
+!     *(DB_MPOOLFILE **)&jresult = result; 
+      return jresult;
+  }
+  
+***************
+*** 2529,2536 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2490,2496 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2556,2563 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2516,2522 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2583,2590 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2542,2548 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2610,2617 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2568,2574 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2637,2644 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2594,2600 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2664,2671 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2620,2626 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2691,2698 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2646,2652 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2718,2725 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2672,2678 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2745,2752 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2698,2704 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2774,2781 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2726,2732 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2801,2808 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2752,2758 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2828,2835 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2778,2784 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2857,2864 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 2806,2812 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 2886,2893 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      {
+          int i, count, err;
+          
+--- 2834,2840 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      {
+          int i, count, err;
+          
+***************
+*** 2907,2914 ****
+              }else {
+                  jlong jptr = (*jenv)->GetLongField(jenv, jobj,
+                  dbc_cptr_fid);
+!                 arg2[i] = (DBC *)((intptr_t)jptr);
+! /*                arg2[i] = *(DBC **)&jptr; */
+              }
+          }
+          arg2[count] = NULL;
+--- 2854,2860 ----
+              }else {
+                  jlong jptr = (*jenv)->GetLongField(jenv, jobj,
+                  dbc_cptr_fid);
+!                 arg2[i] = *(DBC **)&jptr;
+              }
+          }
+          arg2[count] = NULL;
+***************
+*** 2927,2934 ****
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(DBC **)&jresult = result; */
+      
+      __os_free(NULL, arg2);
+      
+--- 2873,2879 ----
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, DB2JDBENV);
+      
+!     *(DBC **)&jresult = result; 
+      
+      __os_free(NULL, arg2);
+      
+***************
+*** 2948,2957 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return ;
+--- 2893,2900 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return ;
+***************
+*** 2996,3005 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      {
+          arg3 = 0;
+          if (jarg3) {
+--- 2939,2946 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      {
+          arg3 = 0;
+          if (jarg3) {
+***************
+*** 3053,3062 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+--- 2994,3001 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+***************
+*** 3112,3121 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+--- 3051,3058 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+***************
+*** 3159,3166 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 3096,3102 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 3207,3214 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 3143,3149 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 3262,3269 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_append_recno;
+      
+--- 3197,3203 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_append_recno;
+      
+***************
+*** 3289,3296 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_bt_compare;
+      
+--- 3223,3229 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_bt_compare;
+      
+***************
+*** 3316,3323 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3249,3255 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3341,3348 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3273,3279 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3366,3373 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_bt_prefix;
+      
+--- 3297,3303 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_bt_prefix;
+      
+***************
+*** 3394,3401 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = jarg2; 
+      arg3 = (int)jarg3; 
+      
+--- 3324,3330 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = jarg2; 
+      arg3 = (int)jarg3; 
+      
+***************
+*** 3420,3427 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_dup_compare;
+      
+--- 3349,3355 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_dup_compare;
+      
+***************
+*** 3448,3455 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 3376,3382 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 3483,3490 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_db_feedback;
+      
+--- 3410,3416 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_db_feedback;
+      
+***************
+*** 3510,3517 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3436,3442 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3535,3542 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3460,3466 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3560,3567 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_h_hash;
+      
+--- 3484,3490 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_h_hash;
+      
+***************
+*** 3587,3594 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3510,3516 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3612,3619 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (int)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3534,3540 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (int)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3637,3644 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3558,3564 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3662,3669 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (int)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3582,3588 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (int)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3687,3694 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3606,3612 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3712,3719 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (int)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3630,3636 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (int)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3737,3744 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 3654,3660 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 3771,3778 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3687,3693 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3797,3804 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3712,3718 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3875,3882 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3789,3795 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3902,3911 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      arg3 = (u_int32_t)jarg3; 
+      
+      if (jarg1 == 0) {
+--- 3815,3822 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+      if (jarg1 == 0) {
+***************
+*** 3933,3940 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 3844,3850 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 3972,3979 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 3882,3888 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 4024,4031 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __dbc *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __dbc **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 3933,3939 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __dbc **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 4049,4056 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __dbc *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __dbc **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3957,3963 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __dbc **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 4078,4085 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __dbc *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __dbc **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 3985,3991 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __dbc **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 4106,4113 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __dbc *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __dbc **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 4012,4018 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __dbc **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 4122,4129 ****
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, DBC2JDBENV);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(DBC **)&jresult = result; */
+      return jresult;
+  }
+  
+--- 4027,4033 ----
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, DBC2JDBENV);
+      
+!     *(DBC **)&jresult = result; 
+      return jresult;
+  }
+  
+***************
+*** 4140,4147 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __dbc *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __dbc **)&jarg1; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return 0;
+--- 4044,4050 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __dbc **)&jarg1; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return 0;
+***************
+*** 4190,4198 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __dbc *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __dbc **)&jarg1; */
+! 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return 0;
+--- 4093,4099 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __dbc **)&jarg1; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return 0;
+***************
+*** 4247,4255 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __dbc *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __dbc **)&jarg1; */
+! 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return 0;
+--- 4148,4154 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __dbc **)&jarg1; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return 0;
+***************
+*** 4299,4306 ****
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, NULL);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(struct __db_env **)&jresult = result; */
+      return jresult;
+  }
+  
+--- 4198,4204 ----
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, NULL);
+      
+!     *(struct __db_env **)&jresult = result; 
+      return jresult;
+  }
+  
+***************
+*** 4312,4319 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 4210,4216 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 4340,4349 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      {
+          arg3 = 0;
+          if (jarg3) {
+--- 4237,4244 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      {
+          arg3 = 0;
+          if (jarg3) {
+***************
+*** 4391,4400 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      {
+          arg3 = 0;
+          if (jarg3) {
+--- 4286,4293 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      {
+          arg3 = 0;
+          if (jarg3) {
+***************
+*** 4448,4455 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (int)jarg2; 
+      {
+          arg3 = 0;
+--- 4341,4347 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (int)jarg2; 
+      {
+          arg3 = 0;
+***************
+*** 4478,4485 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 4370,4376 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 4508,4515 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 4399,4405 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 4551,4558 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 4441,4447 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 4578,4585 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 4467,4473 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 4605,4612 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 4493,4499 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 4634,4641 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 4521,4527 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 4661,4668 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 4547,4553 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 4688,4695 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 4573,4579 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 4715,4722 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 4599,4605 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 4745,4752 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 4628,4634 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 4777,4784 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 4659,4665 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 4814,4821 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 4695,4701 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 4850,4857 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = jarg2; 
+      arg3 = (int)jarg3; 
+      
+--- 4730,4736 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = jarg2; 
+      arg3 = (int)jarg3; 
+      
+***************
+*** 4876,4883 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 4755,4761 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 4911,4918 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 4789,4795 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 4945,4952 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_error;
+      
+--- 4822,4828 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_error;
+      
+***************
+*** 4969,4976 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      arg3 = (jarg3 == JNI_TRUE);
+--- 4845,4851 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      arg3 = (jarg3 == JNI_TRUE);
+***************
+*** 4997,5004 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_env_feedback;
+      
+--- 4872,4878 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_env_feedback;
+      
+***************
+*** 5024,5031 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (size_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 4898,4904 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (size_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5049,5056 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_panic;
+      
+--- 4922,4928 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_panic;
+      
+***************
+*** 5080,5089 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+!     arg2 = (void *)((intptr_t)jarg2);
+! /*    arg2 = *(void **)&jarg2; */
+      {
+          arg3 = 0;
+          if (jarg3) {
+--- 4952,4959 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+!     arg2 = *(void **)&jarg2; 
+      {
+          arg3 = 0;
+          if (jarg3) {
+***************
+*** 5126,5133 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (long)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 4996,5002 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (long)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5151,5158 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5020,5026 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5177,5184 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (db_timeout_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+--- 5045,5051 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (db_timeout_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+***************
+*** 5203,5210 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 5070,5076 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 5237,5244 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5103,5109 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5262,5269 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_app_dispatch;
+      
+--- 5127,5133 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      arg2 = (jarg2 == NULL) ? NULL : __dbj_app_dispatch;
+      
+***************
+*** 5290,5297 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      time2 = (time_t)jarg2;
+      arg2 = &time2;
+--- 5154,5160 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      time2 = (time_t)jarg2;
+      arg2 = &time2;
+***************
+*** 5319,5326 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      arg3 = (jarg3 == JNI_TRUE);
+--- 5182,5188 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      arg3 = (jarg3 == JNI_TRUE);
+***************
+*** 5347,5354 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5209,5215 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5390,5397 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5251,5257 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5417,5424 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5277,5283 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5444,5451 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5303,5309 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5471,5478 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5329,5335 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5500,5507 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+--- 5357,5363 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+***************
+*** 5534,5541 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+--- 5390,5396 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+***************
+*** 5562,5569 ****
+      }else if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(DB_LOCK **)&jresult = result; */
+      
+      if (ldbt4.jarr != NULL) {
+          (*jenv)->ReleaseByteArrayElements(jenv, ldbt4.jarr,
+--- 5417,5423 ----
+      }else if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
+      
+!     *(DB_LOCK **)&jresult = result; 
+      
+      if (ldbt4.jarr != NULL) {
+          (*jenv)->ReleaseByteArrayElements(jenv, ldbt4.jarr,
+***************
+*** 5581,5588 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5435,5441 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5608,5615 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5461,5467 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5633,5642 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+!     arg2 = (DB_LOCK *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_LOCK **)&jarg2; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5485,5492 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+!     arg2 = *(DB_LOCK **)&jarg2; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5660,5667 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5510,5516 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5693,5700 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      {
+          int i, len, err;
+          size_t bytesize;
+--- 5542,5548 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      {
+          int i, len, err;
+          size_t bytesize;
+***************
+*** 5739,5746 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5587,5593 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5764,5771 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5611,5617 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5789,5796 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5635,5641 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5814,5821 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5659,5665 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5839,5846 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5683,5689 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5866,5873 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5709,5715 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5895,5902 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5737,5743 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5922,5929 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5763,5769 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 5950,5957 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5790,5796 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 5996,6005 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (DB_LSN *)((intptr_t)jarg1);
+! /*    arg1 = *(DB_LSN **)&jarg1; */
+!     arg2 = (DB_LSN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_LSN **)&jarg2; */
+      result = (int)DbEnv_log_compare((DB_LSN const *)arg1,(DB_LSN const *)arg2);
+      
+      jresult = (jint)result; 
+--- 5835,5842 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(DB_LSN **)&jarg1; 
+!     arg2 = *(DB_LSN **)&jarg2; 
+      result = (int)DbEnv_log_compare((DB_LSN const *)arg1,(DB_LSN const *)arg2);
+      
+      jresult = (jint)result; 
+***************
+*** 6015,6022 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5852,5858 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6031,6038 ****
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(DB_LOGC **)&jresult = result; */
+      return jresult;
+  }
+  
+--- 5867,5873 ----
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
+      
+!     *(DB_LOGC **)&jresult = result; 
+      return jresult;
+  }
+  
+***************
+*** 6045,6054 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+!     arg2 = (DB_LSN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_LSN **)&jarg2; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5880,5887 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+!     arg2 = *(DB_LSN **)&jarg2; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 6076,6085 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+!     arg2 = (DB_LSN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_LSN **)&jarg2; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 5909,5916 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+!     arg2 = *(DB_LSN **)&jarg2; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 6105,6114 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+!     arg2 = (DB_LSN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_LSN **)&jarg2; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return ;
+--- 5936,5943 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+!     arg2 = *(DB_LSN **)&jarg2; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return ;
+***************
+*** 6144,6151 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 5973,5979 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6177,6184 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6005,6011 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6202,6209 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      {
+          arg2 = 0;
+          if (jarg2) {
+--- 6029,6035 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      {
+          arg2 = 0;
+          if (jarg2) {
+***************
+*** 6236,6243 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6062,6068 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6261,6268 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6086,6092 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6286,6293 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 6110,6116 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 6313,6320 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 6136,6142 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 6340,6347 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 6162,6168 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 6368,6375 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6189,6195 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6402,6409 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6222,6228 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6453,6460 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (int)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6272,6278 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (int)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6481,6488 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 6299,6305 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 6508,6515 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 6325,6331 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 6536,6543 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6352,6358 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6566,6575 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+!     arg2 = (DB_TXN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_TXN **)&jarg2; */
+      arg3 = (u_int32_t)jarg3; 
+      
+      if (jarg1 == 0) {
+--- 6381,6388 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+!     arg2 = *(DB_TXN **)&jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6584,6591 ****
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(DB_TXN **)&jresult = result; */
+      return jresult;
+  }
+  
+--- 6397,6403 ----
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, JDBENV);
+      
+!     *(DB_TXN **)&jresult = result; 
+      return jresult;
+  }
+  
+***************
+*** 6599,6606 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      arg4 = (u_int32_t)jarg4; 
+--- 6411,6417 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      arg4 = (u_int32_t)jarg4; 
+***************
+*** 6628,6635 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (int)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+--- 6439,6445 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (int)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+***************
+*** 6684,6691 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6494,6500 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6738,6745 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 6547,6553 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 6768,6775 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (int)jarg2; 
+      arg3 = (int)jarg3; 
+      arg4 = (u_int32_t)jarg4; 
+--- 6576,6582 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (int)jarg2; 
+      arg3 = (int)jarg3; 
+      arg4 = (u_int32_t)jarg4; 
+***************
+*** 6805,6812 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return 0;
+--- 6612,6618 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return 0;
+***************
+*** 6821,6828 ****
+      id4 = (*jenv)->GetIntField(jenv, jarg4, rep_processmsg_envid);
+      arg4 = &id4;
+      
+!     arg5 = (DB_LSN *)((intptr_t)jarg5);
+! /*    arg5 = *(DB_LSN **)&jarg5; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 6627,6633 ----
+      id4 = (*jenv)->GetIntField(jenv, jarg4, rep_processmsg_envid);
+      arg4 = &id4;
+      
+!     arg5 = *(DB_LSN **)&jarg5; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 6858,6865 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return ;
+--- 6663,6669 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt2, jarg2) != 0)
+      return ;
+***************
+*** 6892,6899 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6696,6702 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6925,6932 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6728,6734 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 6951,6958 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_env *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_env **)&jarg1; */
+      arg2 = (int)jarg2; 
+      
+      arg3 = (jarg3 == NULL) ? NULL : __dbj_rep_transport;
+--- 6753,6759 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_env **)&jarg1; 
+      arg2 = (int)jarg2; 
+      
+      arg3 = (jarg3 == NULL) ? NULL : __dbj_rep_transport;
+***************
+*** 7049,7056 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_txn *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_txn **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 6850,6856 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_txn **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 7073,7080 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_txn *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_txn **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6873,6879 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_txn **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 7098,7105 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_txn *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_txn **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 6897,6903 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_txn **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 7123,7130 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_txn *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_txn **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 6921,6927 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_txn **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 7145,7152 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_txn *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_txn **)&jarg1; */
+      
+      arg2 = (u_int8_t *)(*jenv)->GetByteArrayElements(jenv, jarg2, NULL);
+      
+--- 6942,6948 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_txn **)&jarg1; 
+      
+      arg2 = (u_int8_t *)(*jenv)->GetByteArrayElements(jenv, jarg2, NULL);
+      
+***************
+*** 7183,7190 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_txn *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_txn **)&jarg1; */
+      arg2 = (db_timeout_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+--- 6979,6985 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_txn **)&jarg1; 
+      arg2 = (db_timeout_t)jarg2; 
+      arg3 = (u_int32_t)jarg3; 
+      
+***************
+*** 7209,7216 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_log_cursor *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_log_cursor **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 7004,7010 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_log_cursor **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 7238,7247 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_log_cursor *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_log_cursor **)&jarg1; */
+!     arg2 = (DB_LSN *)((intptr_t)jarg2);
+! /*    arg2 = *(DB_LSN **)&jarg2; */
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+--- 7032,7039 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_log_cursor **)&jarg1; 
+!     arg2 = *(DB_LSN **)&jarg2; 
+      
+      if (__dbj_dbt_copyin(jenv, &ldbt3, jarg3) != 0)
+      return 0;
+***************
+*** 7273,7280 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_lock_u *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_lock_u **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 7065,7071 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_lock_u **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 7303,7310 ****
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, NULL);
+      
+!     jresult = (jlong)((intptr_t)result);
+! /*    *(struct __db_lsn **)&jresult = result; */
+      return jresult;
+  }
+  
+--- 7094,7100 ----
+      if (!DB_RETOK_STD(errno))
+      __dbj_throw(jenv, errno, NULL, NULL, NULL);
+      
+!     *(struct __db_lsn **)&jresult = result; 
+      return jresult;
+  }
+  
+***************
+*** 7314,7321 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_lsn *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_lsn **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 7104,7110 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_lsn **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 7334,7341 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_lsn *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_lsn **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 7123,7129 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_lsn **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 7356,7363 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_lsn *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_lsn **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 7144,7150 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_lsn **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 7378,7385 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_mpoolfile *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_mpoolfile **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 7165,7171 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_mpoolfile **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 7405,7412 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_mpoolfile *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_mpoolfile **)&jarg1; */
+      arg2 = (DB_CACHE_PRIORITY)jarg2; 
+      
+      if (jarg1 == 0) {
+--- 7191,7197 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_mpoolfile **)&jarg1; 
+      arg2 = (DB_CACHE_PRIORITY)jarg2; 
+      
+      if (jarg1 == 0) {
+***************
+*** 7430,7437 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_mpoolfile *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_mpoolfile **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 7215,7221 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_mpoolfile **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 7458,7465 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_mpoolfile *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_mpoolfile **)&jarg1; */
+      arg2 = (u_int32_t)jarg2; 
+      
+      arg3 = (jarg3 == JNI_TRUE);
+--- 7242,7248 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_mpoolfile **)&jarg1; 
+      arg2 = (u_int32_t)jarg2; 
+      
+      arg3 = (jarg3 == JNI_TRUE);
+***************
+*** 7486,7493 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_mpoolfile *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_mpoolfile **)&jarg1; */
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+--- 7269,7275 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_mpoolfile **)&jarg1; 
+      
+      if (jarg1 == 0) {
+          __dbj_throw(jenv, EINVAL, "call on closed handle", NULL, NULL);
+***************
+*** 7513,7520 ****
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = (struct __db_mpoolfile *)((intptr_t)jarg1);
+! /*    arg1 = *(struct __db_mpoolfile **)&jarg1; */
+      arg2 = jarg2; 
+      
+      if (jarg1 == 0) {
+--- 7295,7301 ----
+      
+      (void)jenv;
+      (void)jcls;
+!     arg1 = *(struct __db_mpoolfile **)&jarg1; 
+      arg2 = jarg2; 
+      
+      if (jarg1 == 0) {
+diff -cNr misc/build/db-4.2.52.NC.orig/libdb_java/db_java_wrap.c.rej misc/build/db-4.2.52.NC/libdb_java/db_java_wrap.c.rej
+*** misc/build/db-4.2.52.NC.orig/libdb_java/db_java_wrap.c.rej	1970-01-01 01:00:00.000000000 +0100
+--- misc/build/db-4.2.52.NC/libdb_java/db_java_wrap.c.rej	2006-01-29 14:18:11.000000000 +0100
+***************
+*** 0 ****
+--- 1,96 ----
++ ***************
++ *** 1192,1231 ****
++   }
++   
++   
++ - JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbEnvRef0(
++       JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
++   	DB_ENV *self = *(DB_ENV **)&jarg1;
++   	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);
++   }
++   
++ - JNIEXPORT jobject JNICALL Java_com_sleepycat_db_db_1javaJNI_initDbRef0(
++       JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg2) {
++   	DB *self = *(DB **)&jarg1;
++   	COMPQUIET(jcls, NULL);
++   
++   	DB_INTERNAL(self) = (void *)(*jenv)->NewGlobalRef(jenv, jarg2);
++ - 	return (jobject)DB_INTERNAL(self);
++   }
++   
++   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;
++   	COMPQUIET(jcls, NULL);
++ - 	COMPQUIET(jenv, NULL);
++   
++ - 	return (jobject)DB_INTERNAL(self);
++   }
++   
++   JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
++ --- 1192,1227 ----
++   }
++   
++   
++ + 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);
++ + 	*(jobject *)&ret = (jobject)DB_ENV_INTERNAL(self);
++ + 	return (ret);
++   }
++   
++ + 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);
++ + 	*(jobject *)&ret = (jobject)DB_INTERNAL(self);
++ + 	return (ret);
++   }
++   
++   JNIEXPORT void JNICALL Java_com_sleepycat_db_db_1javaJNI_deleteRef0(
++       JNIEnv *jenv, jclass jcls, jlong jarg1) {
++ + 	jobject jref = *(jobject *)&jarg1;
++   	COMPQUIET(jcls, NULL);
++   
++ + 	if (jref != 0L)
++ + 		(*jenv)->DeleteGlobalRef(jenv, jref);
++   }
++   
++   JNIEXPORT jlong JNICALL Java_com_sleepycat_db_db_1javaJNI_getDbEnv0(
++ ***************
++ *** 1237,1243 ****
++   	COMPQUIET(jcls, NULL);
++   
++   	*(DB_ENV **)&env_cptr = self->dbenv;
++ - 	return env_cptr;
++   }
++   
++   JNIEXPORT jboolean JNICALL
++ --- 1233,1239 ----
++   	COMPQUIET(jcls, NULL);
++   
++   	*(DB_ENV **)&env_cptr = self->dbenv;
++ + 	return (env_cptr);
++   }
++   
++   JNIEXPORT jboolean JNICALL
+diff -cNr misc/build/db-4.2.52.NC.orig/lock/lock.c misc/build/db-4.2.52.NC/lock/lock.c
+*** misc/build/db-4.2.52.NC.orig/lock/lock.c	2003-11-21 03:40:10.000000000 +0100
+--- misc/build/db-4.2.52.NC/lock/lock.c	2006-01-29 14:16:32.000000000 +0100
+***************
+*** 2216,2226 ****
+  					dp = (u_int8_t *)dp +		\
+  					    sizeof(db_pgno_t);		\
+  				} while (0)
+! #define COPY_OBJ(dp, obj)	do {					   \
+! 					memcpy(dp, obj->data, obj->size);  \
+! 					dp = (u_int8_t *)dp +		   \
+! 					     ALIGN(obj->size,		   \
+! 					     sizeof(u_int32_t)); 	   \
+  				} while (0)
+  
+  #define GET_COUNT(dp, count)	do {					\
+--- 2216,2227 ----
+  					dp = (u_int8_t *)dp +		\
+  					    sizeof(db_pgno_t);		\
+  				} while (0)
+! #define COPY_OBJ(dp, obj)	do {					\
+! 					memcpy(dp,			\
+! 					    (obj)->data, (obj)->size);  \
+! 					dp = (u_int8_t *)dp +		\
+! 					     ALIGN((obj)->size,		\
+! 					    sizeof(u_int32_t)); 	\
+  				} while (0)
+  
+  #define GET_COUNT(dp, count)	do {					\
+***************
+*** 2339,2345 ****
+  		for (i = 0; i < nlocks; i = j) {
+  			PUT_PCOUNT(dp, obj[i].ulen);
+  			PUT_SIZE(dp, obj[i].size);
+! 			COPY_OBJ(dp, obj);
+  			lock = (DB_LOCK_ILOCK *)obj[i].data;
+  			for (j = i + 1; j <= i + obj[i].ulen; j++) {
+  				lock = (DB_LOCK_ILOCK *)obj[j].data;
+--- 2340,2346 ----
+  		for (i = 0; i < nlocks; i = j) {
+  			PUT_PCOUNT(dp, obj[i].ulen);
+  			PUT_SIZE(dp, obj[i].size);
+! 			COPY_OBJ(dp, &obj[i]);
+  			lock = (DB_LOCK_ILOCK *)obj[i].data;
+  			for (j = i + 1; j <= i + obj[i].ulen; j++) {
+  				lock = (DB_LOCK_ILOCK *)obj[j].data;
+diff -cNr misc/build/db-4.2.52.NC.orig/mp/mp_fget.c misc/build/db-4.2.52.NC/mp/mp_fget.c
+*** misc/build/db-4.2.52.NC.orig/mp/mp_fget.c	2003-09-25 17:29:02.000000000 +0200
+--- misc/build/db-4.2.52.NC/mp/mp_fget.c	2006-01-29 14:16:21.000000000 +0100
+***************
+*** 440,446 ****
+  		c_mp->stat.st_pages--;
+  		alloc_bhp = NULL;
+  		R_UNLOCK(dbenv, &dbmp->reginfo[n_cache]);
+- 		MUTEX_LOCK(dbenv, &hp->hash_mutex);
+  
+  		/*
+  		 * We can't use the page we found in the pool if DB_MPOOL_NEW
+--- 440,445 ----
+***************
+*** 455,460 ****
+--- 454,462 ----
+  			b_incr = 0;
+  			goto alloc;
+  		}
++ 
++ 		/* We can use the page -- get the bucket lock. */
++ 		MUTEX_LOCK(dbenv, &hp->hash_mutex);
+  		break;
+  	case SECOND_MISS:
+  		/*
+diff -cNr misc/build/db-4.2.52.NC.orig/mp/mp_fput.c misc/build/db-4.2.52.NC/mp/mp_fput.c
+*** misc/build/db-4.2.52.NC.orig/mp/mp_fput.c	2003-09-30 19:42:07.000000000 +0200
+--- misc/build/db-4.2.52.NC/mp/mp_fput.c	2006-01-29 14:16:21.000000000 +0100
+***************
+*** 285,290 ****
+--- 285,291 ----
+  		    bhp != NULL; bhp = SH_TAILQ_NEXT(bhp, hq, __bh))
+  			if (bhp->priority != UINT32_T_MAX &&
+  			    bhp->priority > MPOOL_BASE_DECREMENT)
++ 				bhp->priority -= MPOOL_BASE_DECREMENT;
+  		MUTEX_UNLOCK(dbenv, &hp->hash_mutex);
+  	}
+  }
+diff -cNr misc/build/db-4.2.52.NC.orig/txn/txn.c misc/build/db-4.2.52.NC/txn/txn.c
+*** misc/build/db-4.2.52.NC.orig/txn/txn.c	2003-12-03 15:33:06.000000000 +0100
+--- misc/build/db-4.2.52.NC/txn/txn.c	2006-01-29 14:50:27.000000000 +0100
+***************
+*** 127,133 ****
+  	if ((ret = __db_fchk(dbenv,
+  	    "txn_begin", flags,
+  	    DB_DIRTY_READ | DB_TXN_NOWAIT |
+! 	    DB_TXN_NOSYNC | DB_TXN_SYNC)) != 0)
+  		return (ret);
+  	if ((ret = __db_fcchk(dbenv,
+  	    "txn_begin", flags, DB_TXN_NOSYNC, DB_TXN_SYNC)) != 0)
+--- 127,133 ----
+  	if ((ret = __db_fchk(dbenv,
+  	    "txn_begin", flags,
+  	    DB_DIRTY_READ | DB_TXN_NOWAIT |
+! 	    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,198 ****
+--- 193,200 ----
+  		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,334 ****
+  	 * We should set this value when we write the first log record, not
+  	 * here.
+  	 */
+! 	if (DBENV_LOGGING(dbenv))
+  		__log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
+  	else
+  		ZERO_LSN(begin_lsn);
+--- 330,336 ----
+  	 * We should set this value when we write the first log record, not
+  	 * here.
+  	 */
+! 	if (DBENV_LOGGING(dbenv) && !F_ISSET(txn, TXN_NOLOG))
+  		__log_txn_lsn(dbenv, &begin_lsn, NULL, NULL);
+  	else
+  		ZERO_LSN(begin_lsn);
+*** misc/build/db-4.2.52.NC/dist/configure.ac.badpath	2006-01-29 19:10:22.000000000 +0100
+--- misc/build/db-4.2.52.NC/dist/configure.ac	2006-01-29 19:32:33.000000000 +0100
+***************
+*** 409,424 ****
+  	if test -z "$PKG_CONFIG"; then
+  		AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  	fi
+! 	if test -z "$JNI_INCLUDE_DIRS"; then
+  		if $PKG_CONFIG --exists libgcj ; then
+  			CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags libgcj`"
+  		fi
+  	else
+  	for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
+  	do
+! 		CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
+  	done
+  	fi
+  
+  	ADDITIONAL_LANG="$ADDITIONAL_LANG java"
+  	INSTALL_LIBS="$INSTALL_LIBS \$(libjso_target)"
+--- 409,425 ----
+  	if test -z "$PKG_CONFIG"; then
+  		AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+  	fi
+! 	if test -z "$JNI_INCLUDE_DIRS" -o "${JNI_INCLUDE_DIRS:(-20):20}" = "../usr/include/linux"; then
+  		if $PKG_CONFIG --exists libgcj ; then
+  			CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags libgcj`"
+  		fi
+  	else
+  	for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
+  	do
+! 		CPPFLAGS="$CPPFLAGS"
+  	done
+  	fi
++ 	echo "JNI_INCLUDES_DIR: $JNI_INCLUDE_DIRS (CPPFLAGS: $CPPFLAGS)"
+  
+  	ADDITIONAL_LANG="$ADDITIONAL_LANG java"
+  	INSTALL_LIBS="$INSTALL_LIBS \$(libjso_target)"
--- berkeleydb/makefile.mk.miscdb42	2006-01-13 17:23:55.000000000 +0100
+++ berkeleydb/makefile.mk	2006-01-29 16:01:23.000000000 +0100
@@ -82,12 +82,14 @@
 CONFIGURE_ACTION= \
 	setenv CFLAGS "$(ARCH_FLAGS)" && \
 	setenv CXXFLAGS "$(ARCH_FLAGS)" && \
-	..$/dist$/configure
-CONFIGURE_FLAGS=--disable-cxx --enable-dynamic --enable-shared --enable-compat185
+	(cd ../dist;./s_config) && ..$/dist$/configure
+CONFIGURE_FLAGS=--enable-cxx --enable-dynamic --enable-shared --enable-compat185
 .IF "$(SOLAR_JAVA)"!=""
 CONFIGURE_FLAGS+=--enable-java
 .ENDIF
 
+CONFIGURE_FLAGS+=--enable-dump185 --enable-rpc --disable-pthreadsmutexes
+
 BUILD_DIR=$(CONFIGURE_DIR)
 BUILD_DIR_OUT=$(CONFIGURE_DIR)
 .IF "$(OS)"=="IRIX"
