diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 60bd2cab8..1d91aa12f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -64,24 +64,23 @@ jobs:
- name: Test
run: mvn --batch-mode --no-transfer-progress test
-# test_graalvm:
-# name: test ubuntu-latest jdk11 GraalVM native-image
-# runs-on: ubuntu-latest
-# steps:
-# - uses: actions/checkout@v3
-# - uses: DeLaGuardo/setup-graalvm@master
-# with:
-# # GraalVM version, no pattern syntax available atm
-# graalvm: '21.0.0.2'
-# # Java version, optional, defaults to 'java8'. Available options are 'java8' and 'java11'.
-# java: 'java11'
-# # Architecture flag, optional, defaults to 'amd64'. Available options are 'amd64' and 'aarch64'. Later is available only for linux runners.
-# arch: 'amd64'
-# - name: Install native-image component
-# run: |
-# gu install native-image
-# - name: Test
-# run: mvn --batch-mode --no-transfer-progress -P native test
+ test_graalvm:
+ name: test ${{ matrix.os }} jdk${{ matrix.java }} GraalVM native-image
+ strategy:
+ matrix:
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
+ java: [ 11, 17 ]
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v3
+ - uses: graalvm/setup-graalvm@v1
+ with:
+ version: '22.3.0'
+ java-version: ${{ matrix.java }}
+ components: 'native-image'
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ - name: Test
+ run: mvn --batch-mode --no-transfer-progress -P native test
test_multiarch:
name: test ${{ matrix.arch }} ${{ matrix.distro }} jdk${{ matrix.java }}
diff --git a/Makefile.common b/Makefile.common
index 169f9e127..cbf450914 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -63,77 +63,77 @@ CROSS_PREFIX :=
Default_CC := $(CROSS_PREFIX)gcc
Default_STRIP := $(CROSS_PREFIX)strip
Default_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -Os -fPIC -fvisibility=hidden
-Default_LINKFLAGS := -shared
+Default_LINKFLAGS := -shared -static-libgcc -pthread -lm
Default_LIBNAME := libsqlitejdbc.so
Default_SQLITE_FLAGS :=
Linux-x86_CC := $(CROSS_PREFIX)gcc
Linux-x86_STRIP := $(CROSS_PREFIX)strip
Linux-x86_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -Os -fPIC -m32 -fvisibility=hidden
-Linux-x86_LINKFLAGS := -shared -static-libgcc
+Linux-x86_LINKFLAGS := $(Default_LINKFLAGS)
Linux-x86_LIBNAME := libsqlitejdbc.so
Linux-x86_SQLITE_FLAGS :=
Linux-x86_64_CC := $(CROSS_PREFIX)gcc
Linux-x86_64_STRIP := $(CROSS_PREFIX)strip
Linux-x86_64_CCFLAGS := -Ilib/inc_linux -I$(JAVA_HOME)/include -Os -fPIC -m64 -fvisibility=hidden
-Linux-x86_64_LINKFLAGS := -shared -static-libgcc
+Linux-x86_64_LINKFLAGS := $(Default_LINKFLAGS)
Linux-x86_64_LIBNAME := libsqlitejdbc.so
Linux-x86_64_SQLITE_FLAGS :=
Linux-arm_CC := $(CROSS_PREFIX)gcc
Linux-arm_STRIP := $(CROSS_PREFIX)strip
Linux-arm_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -Os -fPIC -mfloat-abi=soft -fvisibility=hidden
-Linux-arm_LINKFLAGS := -shared -static-libgcc
+Linux-arm_LINKFLAGS := $(Default_LINKFLAGS)
Linux-arm_LIBNAME := libsqlitejdbc.so
Linux-arm_SQLITE_FLAGS :=
Linux-armv6_CC := $(CROSS_PREFIX)gcc
Linux-armv6_STRIP := $(CROSS_PREFIX)strip
Linux-armv6_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -Os -mfloat-abi=hard -mfpu=vfp -fPIC -fvisibility=hidden
-Linux-armv6_LINKFLAGS := -shared -static-libgcc
+Linux-armv6_LINKFLAGS := $(Default_LINKFLAGS)
Linux-armv6_LIBNAME := libsqlitejdbc.so
Linux-armv6_SQLITE_FLAGS :=
Linux-armv7_CC := $(CROSS_PREFIX)gcc
Linux-armv7_STRIP := $(CROSS_PREFIX)strip
Linux-armv7_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -Os -mfloat-abi=hard -mfpu=vfp -fPIC -fvisibility=hidden
-Linux-armv7_LINKFLAGS := -shared -static-libgcc
+Linux-armv7_LINKFLAGS := $(Default_LINKFLAGS)
Linux-armv7_LIBNAME := libsqlitejdbc.so
Linux-armv7_SQLITE_FLAGS :=
Linux-Android-arm_CC := $(CROSS_PREFIX)clang
Linux-Android-arm_STRIP := $(CROSS_ROOT)/bin/llvm-strip
Linux-Android-arm_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -I$(CROSS_ROOT)/sysroot/usr/include -Os -fPIC -fvisibility=hidden -fPIE -pie -lm -lc -landroid -ldl -llog
-Linux-Android-arm_LINKFLAGS := -shared -static-libgcc
+Linux-Android-arm_LINKFLAGS := $(Default_LINKFLAGS)
Linux-Android-arm_LIBNAME := libsqlitejdbc.so
Linux-Android-arm_SQLITE_FLAGS :=
Linux-Android-aarch64_CC := $(CROSS_PREFIX)clang
Linux-Android-aarch64_STRIP := $(CROSS_ROOT)/bin/llvm-strip
Linux-Android-aarch64_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -I$(CROSS_ROOT)/sysroot/usr/include -Os -fPIC -fvisibility=hidden -fPIE -pie -lm -lc -landroid -ldl -llog
-Linux-Android-aarch64_LINKFLAGS := -shared -static-libgcc
+Linux-Android-aarch64_LINKFLAGS := $(Default_LINKFLAGS)
Linux-Android-aarch64_LIBNAME := libsqlitejdbc.so
Linux-Android-aarch64_SQLITE_FLAGS :=
Linux-Android-x86_CC := $(CROSS_PREFIX)clang
Linux-Android-x86_STRIP := $(CROSS_ROOT)/bin/llvm-strip
Linux-Android-x86_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -I$(CROSS_ROOT)/sysroot/usr/include -Os -fPIC -fvisibility=hidden -fPIE -pie -lm -lc -landroid -ldl -llog
-Linux-Android-x86_LINKFLAGS := -shared -static-libgcc
+Linux-Android-x86_LINKFLAGS := $(Default_LINKFLAGS)
Linux-Android-x86_LIBNAME := libsqlitejdbc.so
Linux-Android-x86_SQLITE_FLAGS :=
Linux-Android-x86_64_CC := $(CROSS_PREFIX)clang
Linux-Android-x86_64_STRIP := $(CROSS_ROOT)/bin/llvm-strip
Linux-Android-x86_64_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -I$(CROSS_ROOT)/sysroot/usr/include -Os -fPIC -fvisibility=hidden -fPIE -pie -lm -lc -landroid -ldl -llog
-Linux-Android-x86_64_LINKFLAGS := -shared -static-libgcc
+Linux-Android-x86_64_LINKFLAGS := $(Default_LINKFLAGS)
Linux-Android-x86_64_LIBNAME := libsqlitejdbc.so
Linux-Android-x86_64_SQLITE_FLAGS :=
Linux-ppc64_CC := $(CROSS_PREFIX)gcc
Linux-ppc64_STRIP := $(CROSS_PREFIX)strip
Linux-ppc64_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_linux -Os -fPIC -fvisibility=hidden
-Linux-ppc64_LINKFLAGS := -shared -static-libgcc
+Linux-ppc64_LINKFLAGS := $(Default_LINKFLAGS)
Linux-ppc64_LIBNAME := libsqlitejdbc.so
Linux-ppc64_SQLITE_FLAGS :=
diff --git a/pom.xml b/pom.xml
index 08e72e973..cae123a84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
UTF-8
5.9.1
- 2.22.2
+ 3.0.0-M7
${project.basedir}/src/main/java9
@@ -336,7 +336,8 @@
org.graalvm.buildtools
native-maven-plugin
- 0.9.3
+ 0.9.19
+ true
test-native
@@ -345,22 +346,18 @@
test
-
- build-native
-
- build
-
- package
-
- sqlite-jdbc-osinfo
- org.sqlite.util.OSInfo
+ false
+ true
- --no-fallback
- --verbose
- --enable-url-protocols=jar
- --report-unsupported-elements-at-runtime
+
+
+ -H:ServiceLoaderFeatureExcludeServiceProviders=com.tngtech.archunit.junit.internal.ArchUnitTestEngine
+
@@ -370,17 +367,9 @@
maven-surefire-plugin
${surefire.version}
-
-
**/MultipleClassLoaderTest.java
-
- **/BusyHandlerTest
-
- **/RSMetaDataTest
-
- **/UDFCustomErrorTest.java
**/architecture/*.java
@@ -388,15 +377,6 @@
-
-
-
- org.graalvm.buildtools
- junit-platform-native
- 0.9.3
- test
-
-
diff --git a/src/main/java/org/sqlite/core/NativeDB.c b/src/main/java/org/sqlite/core/NativeDB.c
index adafb8f61..e578b8aa8 100644
--- a/src/main/java/org/sqlite/core/NativeDB.c
+++ b/src/main/java/org/sqlite/core/NativeDB.c
@@ -29,6 +29,12 @@
static jclass dbclass = 0;
static jfieldID dbpointer = 0;
+static jfieldID db_busyHandler = 0;
+static jfieldID db_commitListener = 0;
+static jfieldID db_updateListener = 0;
+static jfieldID db_progressHandler = 0;
+static jmethodID db_mth_onUpdate = 0;
+static jmethodID db_mth_onCommit = 0;
static jmethodID mth_stringToUtf8ByteArray = 0;
static jmethodID mth_throwex = 0;
static jmethodID mth_throwexcode = 0;
@@ -52,12 +58,20 @@ static jclass wclass = 0;
static jmethodID w_mth_inverse = 0;
static jmethodID w_mth_xvalue = 0;
-static jclass pclass = 0;
+static jclass pobserverclass = 0;
+static jmethodID pobserver_mth_progress = 0;
+
static jclass phandleclass = 0;
-static jmethodID pmethod = 0;
+static jmethodID phandle_mth_progress = 0;
+
+static jclass bhandleclass = 0;
+static jmethodID bhandle_mth_callback = 0;
+static jclass exclass = 0;
static jmethodID exp_msg = 0;
+static jclass bool_array_class = 0;
+
static void * toref(jlong value)
{
void * ret;
@@ -218,7 +232,6 @@ static void sethandle(JNIEnv *env, jobject nativeDB, sqlite3 * ref)
struct BusyHandlerContext {
JavaVM * vm;
- jmethodID methodId;
jobject obj;
};
@@ -228,12 +241,9 @@ static void free_busy_handler(JNIEnv *env, void *toFree) {
free(toFree);
}
-static void set_new_handler(JNIEnv *env, jobject nativeDB, char *fieldName,
+static void set_new_handler(JNIEnv *env, jobject nativeDB, jfieldID handlerField,
void * newHandler, void (*free_handler)(JNIEnv*, void*))
{
- jfieldID handlerField = (*env)->GetFieldID(env, dbclass, fieldName, "J");
- assert(handlerField);
-
void *toFree = toref((*env)->GetLongField(env, nativeDB, handlerField));
if (toFree) {
free_handler(env, toFree);
@@ -434,6 +444,12 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
if (!dbclass) return JNI_ERR;
dbclass = (*env)->NewWeakGlobalRef(env, dbclass);
dbpointer = (*env)->GetFieldID(env, dbclass, "pointer", "J");
+ db_busyHandler = (*env)->GetFieldID(env, dbclass, "busyHandler", "J");
+ db_commitListener = (*env)->GetFieldID(env, dbclass, "commitListener", "J");
+ db_updateListener = (*env)->GetFieldID(env, dbclass, "updateListener", "J");
+ db_progressHandler = (*env)->GetFieldID(env, dbclass, "progressHandler", "J");
+ db_mth_onUpdate = (*env)->GetMethodID(env, dbclass, "onUpdate", "(ILjava/lang/String;Ljava/lang/String;J)V");
+ db_mth_onCommit = (*env)->GetMethodID(env, dbclass, "onCommit", "(Z)V");
mth_stringToUtf8ByteArray = (*env)->GetStaticMethodID(
env, dbclass, "stringToUtf8ByteArray", "(Ljava/lang/String;)[B");
mth_throwex = (*env)->GetMethodID(env, dbclass, "throwex", "()V");
@@ -466,19 +482,31 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
w_mth_inverse = (*env)->GetMethodID(env, wclass, "xInverse", "()V");
w_mth_xvalue = (*env)->GetMethodID(env, wclass, "xValue", "()V");
- pclass = (*env)->FindClass(env, "org/sqlite/core/DB$ProgressObserver");
- if(!pclass) return JNI_ERR;
- pclass = (*env)->NewWeakGlobalRef(env, pclass);
- pmethod = (*env)->GetMethodID(env, pclass, "progress", "(II)V");
+ pobserverclass = (*env)->FindClass(env, "org/sqlite/core/DB$ProgressObserver");
+ if(!pobserverclass) return JNI_ERR;
+ pobserverclass = (*env)->NewWeakGlobalRef(env, pobserverclass);
+ pobserver_mth_progress = (*env)->GetMethodID(env, pobserverclass, "progress", "(II)V");
phandleclass = (*env)->FindClass(env, "org/sqlite/ProgressHandler");
if(!phandleclass) return JNI_ERR;
phandleclass = (*env)->NewWeakGlobalRef(env, phandleclass);
+ phandle_mth_progress = (*env)->GetMethodID(env, phandleclass, "progress", "()I");
+
+ bhandleclass = (*env)->FindClass(env, "org/sqlite/BusyHandler");
+ if(!bhandleclass) return JNI_ERR;
+ bhandleclass = (*env)->NewWeakGlobalRef(env, bhandleclass);
+ bhandle_mth_callback = (*env)->GetMethodID(env, bhandleclass, "callback", "(I)I");
- jclass exclass = (*env)->FindClass(env, "java/lang/Throwable");
+ exclass = (*env)->FindClass(env, "java/lang/Throwable");
+ if(!exclass) return JNI_ERR;
+ exclass = (*env)->NewWeakGlobalRef(env, exclass);
exp_msg = (*env)->GetMethodID(
env, exclass, "toString", "()Ljava/lang/String;");
+ bool_array_class = (*env)->FindClass(env, "[Z");
+ if(!bool_array_class) return JNI_ERR;
+ bool_array_class = (*env)->NewWeakGlobalRef(env, bool_array_class);
+
return JNI_VERSION_1_2;
}
@@ -500,9 +528,15 @@ JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
if (wclass) (*env)->DeleteWeakGlobalRef(env, wclass);
- if (pclass) (*env)->DeleteWeakGlobalRef(env, pclass);
+ if (pobserverclass) (*env)->DeleteWeakGlobalRef(env, pobserverclass);
if (phandleclass) (*env)->DeleteWeakGlobalRef(env, phandleclass);
+
+ if (bhandleclass) (*env)->DeleteWeakGlobalRef(env, bhandleclass);
+
+ if (exclass) (*env)->DeleteWeakGlobalRef(env, exclass);
+
+ if (bool_array_class) (*env)->DeleteWeakGlobalRef(env, bool_array_class);
}
@@ -593,10 +627,10 @@ int busyHandlerCallBack(void* callback, int nbPrevInvok) {
struct BusyHandlerContext *busyHandlerContext = (struct BusyHandlerContext*) callback;
(*(busyHandlerContext->vm))->AttachCurrentThread(busyHandlerContext->vm, (void **)&env, 0);
- return (*env)->CallIntMethod( env,
- busyHandlerContext->obj,
- busyHandlerContext->methodId,
- nbPrevInvok);
+ return (*env)->CallIntMethod(env,
+ busyHandlerContext->obj,
+ bhandle_mth_callback,
+ nbPrevInvok);
}
void change_busy_handler(JNIEnv *env, jobject nativeDB, jobject busyHandler)
@@ -616,10 +650,6 @@ void change_busy_handler(JNIEnv *env, jobject nativeDB, jobject busyHandler)
(*env)->GetJavaVM(env, &busyHandlerContext->vm);
busyHandlerContext->obj = (*env)->NewGlobalRef(env, busyHandler);
- busyHandlerContext->methodId = (*env)->GetMethodID( env,
- (*env)->GetObjectClass(env, busyHandlerContext->obj),
- "callback",
- "(I)I");
}
if (busyHandlerContext) {
@@ -628,7 +658,7 @@ void change_busy_handler(JNIEnv *env, jobject nativeDB, jobject busyHandler)
sqlite3_busy_handler(db, NULL, NULL);
}
- set_new_handler(env, nativeDB, "busyHandler", busyHandlerContext, &free_busy_handler);
+ set_new_handler(env, nativeDB, db_busyHandler, busyHandlerContext, &free_busy_handler);
}
JNIEXPORT void JNICALL Java_org_sqlite_core_NativeDB_busy_1handler(
@@ -1413,8 +1443,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_sqlite_core_NativeDB_column_1metadata(
dbstmt = toref(stmt);
colCount = sqlite3_column_count(dbstmt);
- array = (*env)->NewObjectArray(
- env, colCount, (*env)->FindClass(env, "[Z"), NULL) ;
+ array = (*env)->NewObjectArray(env, colCount, bool_array_class, NULL);
if (!array) { throwex_outofmemory(env); return 0; }
colDataRaw = (jboolean*)malloc(3 * sizeof(jboolean));
@@ -1457,29 +1486,18 @@ JNIEXPORT jobjectArray JNICALL Java_org_sqlite_core_NativeDB_column_1metadata(
// backup function
void reportProgress(JNIEnv* env, jobject func, int remaining, int pageCount) {
- if(!func)
- return;
-
- (*env)->CallVoidMethod(env, func, pmethod, remaining, pageCount);
-}
-
-jmethodID getBackupRestoreMethod(JNIEnv *env, jobject progress) {
- if(!progress)
- return 0;
+ if(!func)
+ return;
- jmethodID ret = (*env)->GetMethodID(env,
- (*env)->GetObjectClass(env, progress),
- "progress",
- "(II)V");
- return ret;
+ (*env)->CallVoidMethod(env, func, pobserver_mth_progress, remaining, pageCount);
}
-void updateProgress(JNIEnv *env, sqlite3_backup *pBackup, jobject progress, jmethodID progressMth) {
- if (progressMth) {
- int remaining = sqlite3_backup_remaining(pBackup);
- int pagecount = sqlite3_backup_pagecount(pBackup);
- (*env)->CallVoidMethod(env, progress, progressMth, remaining, pagecount);
- }
+void updateProgress(JNIEnv *env, sqlite3_backup *pBackup, jobject progress) {
+ if (!progress)
+ return;
+ int remaining = sqlite3_backup_remaining(pBackup);
+ int pagecount = sqlite3_backup_pagecount(pBackup);
+ (*env)->CallVoidMethod(env, progress, pobserver_mth_progress, remaining, pagecount);
}
void copyLoop(JNIEnv *env, sqlite3_backup *pBackup, jobject progress,
@@ -1487,14 +1505,12 @@ void copyLoop(JNIEnv *env, sqlite3_backup *pBackup, jobject progress,
int rc;
int nTimeout = 0;
- jmethodID progressMth = getBackupRestoreMethod(env, progress);
-
do {
rc = sqlite3_backup_step(pBackup, pagesPerStep);
// if the step completed successfully, update progress
if (rc == SQLITE_OK || rc == SQLITE_DONE) {
- updateProgress(env, pBackup, progress, progressMth);
+ updateProgress(env, pBackup, progress);
}
if (rc == SQLITE_BUSY || rc == SQLITE_LOCKED) {
@@ -1505,7 +1521,6 @@ void copyLoop(JNIEnv *env, sqlite3_backup *pBackup, jobject progress,
} while (rc == SQLITE_OK || rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
}
-
/*
** Perform an online backup of database pDb to the database file named
** by zFilename. This function copies pagesPerStep database pages from pDb to
@@ -1676,7 +1691,6 @@ JNIEXPORT jint JNICALL Java_org_sqlite_core_NativeDB_restore(
struct ProgressHandlerContext {
JavaVM *vm;
- jmethodID mth;
jobject phandler;
};
@@ -1690,7 +1704,7 @@ static int progress_handler_function(void *ctx) {
JNIEnv *env = 0;
struct ProgressHandlerContext* progressHandlerContext = (struct ProgressHandlerContext*) ctx;
(*progressHandlerContext->vm)->AttachCurrentThread(progressHandlerContext->vm, (void **)&env, 0);
- jint rv = (*env)->CallIntMethod(env, progressHandlerContext->phandler, progressHandlerContext->mth);
+ jint rv = (*env)->CallIntMethod(env, progressHandlerContext->phandler, phandle_mth_progress);
return rv;
}
@@ -1711,10 +1725,6 @@ static void change_progress_handler(JNIEnv *env, jobject nativeDB, jobject progr
(*env)->GetJavaVM(env, &progressHandlerContext->vm);
progressHandlerContext->phandler = (*env)->NewGlobalRef(env, progressHandler);
- progressHandlerContext->mth = (*env)->GetMethodID( env,
- (*env)->GetObjectClass(env, progressHandlerContext->phandler),
- "progress",
- "()I");
}
if (progressHandlerContext) {
@@ -1723,7 +1733,7 @@ static void change_progress_handler(JNIEnv *env, jobject nativeDB, jobject progr
sqlite3_progress_handler(gethandle(env, nativeDB), 0, NULL, NULL);
}
- set_new_handler(env, nativeDB, "progressHandler", progressHandlerContext, &free_progress_handler);
+ set_new_handler(env, nativeDB, db_progressHandler, progressHandlerContext, &free_progress_handler);
}
JNIEXPORT void JNICALL Java_org_sqlite_core_NativeDB_register_1progress_1handler(
@@ -1749,7 +1759,6 @@ JNIEXPORT void JNICALL Java_org_sqlite_core_NativeDB_clear_1progress_1handler(
struct UpdateHandlerContext {
JavaVM *vm;
jobject handler;
- jmethodID method;
};
@@ -1761,7 +1770,7 @@ void update_hook(void *context, int type, char const *database, char const *tabl
jstring databaseString = (*env)->NewStringUTF(env, database);
jstring tableString = (*env)->NewStringUTF(env, table);
- (*env)->CallVoidMethod(env, update_handler_context->handler, update_handler_context->method, type, databaseString, tableString, row);
+ (*env)->CallVoidMethod(env, update_handler_context->handler, db_mth_onUpdate, type, databaseString, tableString, row);
(*env)->DeleteLocalRef(env, databaseString);
(*env)->DeleteLocalRef(env, tableString);
@@ -1775,17 +1784,16 @@ static void free_update_handler(JNIEnv *env, void *ctx) {
static void clear_update_listener(JNIEnv *env, jobject nativeDB){
sqlite3_update_hook(gethandle(env, nativeDB), NULL, NULL);
- set_new_handler(env, nativeDB, "updateListener", NULL, &free_update_handler);
+ set_new_handler(env, nativeDB, db_updateListener, NULL, &free_update_handler);
}
JNIEXPORT void JNICALL Java_org_sqlite_core_NativeDB_set_1update_1listener(JNIEnv *env, jobject nativeDB, jboolean enabled) {
if (enabled) {
struct UpdateHandlerContext* update_handler_context = (struct UpdateHandlerContext*) malloc(sizeof(struct UpdateHandlerContext));
- update_handler_context->method = (*env)->GetMethodID(env, dbclass, "onUpdate", "(ILjava/lang/String;Ljava/lang/String;J)V");
update_handler_context->handler = (*env)->NewGlobalRef(env, nativeDB);
(*env)->GetJavaVM(env, &update_handler_context->vm);
sqlite3_update_hook(gethandle(env, nativeDB), &update_hook, update_handler_context);
- set_new_handler(env, nativeDB, "updateListener", update_handler_context, &free_update_handler);
+ set_new_handler(env, nativeDB, db_updateListener, update_handler_context, &free_update_handler);
} else {
clear_update_listener(env, nativeDB);
}
@@ -1796,14 +1804,13 @@ JNIEXPORT void JNICALL Java_org_sqlite_core_NativeDB_set_1update_1listener(JNIEn
struct CommitHandlerContext {
JavaVM *vm;
jobject handler;
- jmethodID method;
};
int commit_hook(void *context) {
struct CommitHandlerContext *commit_handler_context = (struct CommitHandlerContext*) context;
JNIEnv *env = 0;
(*commit_handler_context->vm)->AttachCurrentThread(commit_handler_context->vm, (void **)&env, 0);
- (*env)->CallVoidMethod(env, commit_handler_context->handler, commit_handler_context->method, 1);
+ (*env)->CallVoidMethod(env, commit_handler_context->handler, db_mth_onCommit, 1);
return 0;
}
@@ -1811,7 +1818,7 @@ void rollback_hook(void *context) {
struct CommitHandlerContext *commit_handler_context = (struct CommitHandlerContext*) context;
JNIEnv *env = 0;
(*commit_handler_context->vm)->AttachCurrentThread(commit_handler_context->vm, (void **)&env, 0);
- (*env)->CallVoidMethod(env, commit_handler_context->handler, commit_handler_context->method, 0);
+ (*env)->CallVoidMethod(env, commit_handler_context->handler, db_mth_onCommit, 0);
}
static void freeCommitHandlerCtx(JNIEnv *env, void *ctx) {
@@ -1823,7 +1830,7 @@ static void freeCommitHandlerCtx(JNIEnv *env, void *ctx) {
void clear_commit_listener(JNIEnv *env, jobject nativeDB, sqlite3 *db) {
sqlite3_commit_hook(db, NULL, NULL);
sqlite3_rollback_hook(db, NULL, NULL);
- set_new_handler(env, nativeDB, "commitListener", NULL, freeCommitHandlerCtx);
+ set_new_handler(env, nativeDB, db_commitListener, NULL, freeCommitHandlerCtx);
}
JNIEXPORT void JNICALL Java_org_sqlite_core_NativeDB_set_1commit_1listener(JNIEnv *env, jobject nativeDB, jboolean enabled) {
@@ -1831,11 +1838,10 @@ JNIEXPORT void JNICALL Java_org_sqlite_core_NativeDB_set_1commit_1listener(JNIEn
if (enabled) {
struct CommitHandlerContext *commit_handler_context = (struct CommitHandlerContext*) malloc(sizeof(struct CommitHandlerContext));
commit_handler_context->handler = (*env)->NewGlobalRef(env, nativeDB);
- commit_handler_context->method = (*env)->GetMethodID(env, dbclass, "onCommit", "(Z)V");
(*env)->GetJavaVM(env, &commit_handler_context->vm);
sqlite3_commit_hook(db, &commit_hook, commit_handler_context);
sqlite3_rollback_hook(db, &rollback_hook, commit_handler_context);
- set_new_handler(env, nativeDB, "commitListener", commit_handler_context, freeCommitHandlerCtx);
+ set_new_handler(env, nativeDB, db_commitListener, commit_handler_context, freeCommitHandlerCtx);
} else {
clear_commit_listener(env, nativeDB, db);
}
diff --git a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/jni-config.json b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/jni-config.json
index 6eb7156a0..2110bdc0c 100644
--- a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/jni-config.json
+++ b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/jni-config.json
@@ -1,59 +1,105 @@
[
{
- "name":"org.sqlite.core.DB",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "allDeclaredFields":true,
- "methods":[{"name":"","parameterTypes":["java.lang.String", "java.lang.String", "org.sqlite.SQLiteConfig"] }]
- },
- {
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
"name":"org.sqlite.core.NativeDB",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "allDeclaredFields":true,
- "methods":[{"name":"","parameterTypes":["java.lang.String", "java.lang.String", "org.sqlite.SQLiteConfig"] }]
+ "fields":[
+ {"name":"busyHandler"},
+ {"name":"commitListener"},
+ {"name":"pointer"},
+ {"name":"progressHandler"},
+ {"name":"updateListener"}
+ ],
+ "methods":[
+ {"name":"stringToUtf8ByteArray","parameterTypes":["java.lang.String"] },
+ {"name":"throwex","parameterTypes":["java.lang.String"] }
+ ]
},
{
- "name":"org.sqlite.BusyHandler",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "methods":[{"name":"","parameterTypes":[] }]
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
+ "name":"org.sqlite.core.DB",
+ "methods":[
+ {"name":"onCommit","parameterTypes":["boolean"] },
+ {"name":"onUpdate","parameterTypes":["int","java.lang.String","java.lang.String","long"] },
+ {"name":"throwex","parameterTypes":[] },
+ {"name":"throwex","parameterTypes":["int"] }
+ ]
},
{
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
"name":"org.sqlite.Function",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "allDeclaredFields":true,
- "methods":[{"name":"","parameterTypes":[] }]
+ "fields":[
+ {"name":"args"},
+ {"name":"context"},
+ {"name":"value"}
+ ],
+ "methods":[{"name":"xFunc","parameterTypes":[] }]
},
{
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
"name":"org.sqlite.Collation",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "allDeclaredFields":true,
- "methods":[{"name":"","parameterTypes":[] }]
- },
- {
- "name":"org.sqlite.ProgressHandler",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "methods":[{"name":"","parameterTypes":[] }]
+ "methods":[{"name":"xCompare","parameterTypes":["java.lang.String","java.lang.String"] }]
},
{
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
"name":"org.sqlite.Function$Aggregate",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "methods":[{"name":"","parameterTypes":[] }]
+ "methods":[
+ {"name":"clone","parameterTypes":[] },
+ {"name":"xFinal","parameterTypes":[] },
+ {"name":"xStep","parameterTypes":[] }
+ ]
},
{
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
"name":"org.sqlite.Function$Window",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "methods":[{"name":"","parameterTypes":[] }]
+ "methods":[
+ {"name":"xInverse","parameterTypes":[] },
+ {"name":"xValue","parameterTypes":[] }
+ ]
},
{
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
"name":"org.sqlite.core.DB$ProgressObserver",
- "allDeclaredMethods":true,
- "allPublicMethods": true
+ "methods":[{"name":"progress","parameterTypes":["int","int"] }]
+ },
+ {
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
+ "name":"org.sqlite.ProgressHandler",
+ "methods":[{"name":"progress","parameterTypes":[] }]
+ },
+ {
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
+ "name":"org.sqlite.BusyHandler",
+ "methods":[{"name":"callback","parameterTypes":["int"] }]
+ },
+ {
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
+ "name":"java.lang.Throwable",
+ "methods":[{"name":"toString","parameterTypes":[] }]
+ },
+ {
+ "condition": {
+ "typeReachable": "org.sqlite.core.NativeDB"
+ },
+ "name":"boolean[]"
}
]
diff --git a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/native-image.properties b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/native-image.properties
index 0cff7835a..ab95497d3 100644
--- a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/native-image.properties
+++ b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/native-image.properties
@@ -1 +1 @@
-Args=-H:ResourceConfigurationResources=META-INF/native-image/org.xerial/sqlite-jdbc/resource-config.json
+Args=--enable-url-protocols=jar
diff --git a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json
deleted file mode 100644
index 6eb7156a0..000000000
--- a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json
+++ /dev/null
@@ -1,59 +0,0 @@
-[
- {
- "name":"org.sqlite.core.DB",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "allDeclaredFields":true,
- "methods":[{"name":"","parameterTypes":["java.lang.String", "java.lang.String", "org.sqlite.SQLiteConfig"] }]
- },
- {
- "name":"org.sqlite.core.NativeDB",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "allDeclaredFields":true,
- "methods":[{"name":"","parameterTypes":["java.lang.String", "java.lang.String", "org.sqlite.SQLiteConfig"] }]
- },
- {
- "name":"org.sqlite.BusyHandler",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "methods":[{"name":"","parameterTypes":[] }]
- },
- {
- "name":"org.sqlite.Function",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "allDeclaredFields":true,
- "methods":[{"name":"","parameterTypes":[] }]
- },
- {
- "name":"org.sqlite.Collation",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "allDeclaredFields":true,
- "methods":[{"name":"","parameterTypes":[] }]
- },
- {
- "name":"org.sqlite.ProgressHandler",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "methods":[{"name":"","parameterTypes":[] }]
- },
- {
- "name":"org.sqlite.Function$Aggregate",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "methods":[{"name":"","parameterTypes":[] }]
- },
- {
- "name":"org.sqlite.Function$Window",
- "allDeclaredMethods":true,
- "allPublicMethods": true,
- "methods":[{"name":"","parameterTypes":[] }]
- },
- {
- "name":"org.sqlite.core.DB$ProgressObserver",
- "allDeclaredMethods":true,
- "allPublicMethods": true
- }
-]
diff --git a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/resource-config.json b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/resource-config.json
index 6f371cbbb..72ac4eb46 100644
--- a/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/resource-config.json
+++ b/src/main/resources/META-INF/native-image/org.xerial/sqlite-jdbc/resource-config.json
@@ -3,10 +3,8 @@
"includes":[
{"pattern":"\\QMETA-INF/maven/org.xerial/sqlite-jdbc/VERSION\\E"},
{"pattern":"\\QMETA-INF/maven/org.xerial/sqlite-jdbc/pom.properties\\E"},
- {"pattern":"\\QMETA-INF/services/java.sql.Driver\\E"},
{"pattern":"\\Qsqlite-jdbc.properties\\E"},
- {"pattern":"org/sqlite/native/.*"},
- {"pattern":"org/sqlite/.*"}
+ {"pattern":"org/sqlite/native/.*"}
]},
"bundles":[]
}
diff --git a/src/main/resources/org/sqlite/native/FreeBSD/aarch64/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/FreeBSD/aarch64/libsqlitejdbc.so
index e44e8d706..45d781d83 100755
Binary files a/src/main/resources/org/sqlite/native/FreeBSD/aarch64/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/FreeBSD/aarch64/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/FreeBSD/x86/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/FreeBSD/x86/libsqlitejdbc.so
index e1fffac8f..b7aabf3d0 100755
Binary files a/src/main/resources/org/sqlite/native/FreeBSD/x86/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/FreeBSD/x86/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/FreeBSD/x86_64/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/FreeBSD/x86_64/libsqlitejdbc.so
index 864f2d3e6..3f183f712 100755
Binary files a/src/main/resources/org/sqlite/native/FreeBSD/x86_64/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/FreeBSD/x86_64/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux-Android/aarch64/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux-Android/aarch64/libsqlitejdbc.so
index a4e4785a0..32d261c44 100755
Binary files a/src/main/resources/org/sqlite/native/Linux-Android/aarch64/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux-Android/aarch64/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux-Android/arm/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux-Android/arm/libsqlitejdbc.so
index cac528a00..17985c590 100755
Binary files a/src/main/resources/org/sqlite/native/Linux-Android/arm/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux-Android/arm/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux-Android/x86/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux-Android/x86/libsqlitejdbc.so
index 17c2826cd..035c7137f 100755
Binary files a/src/main/resources/org/sqlite/native/Linux-Android/x86/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux-Android/x86/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux-Android/x86_64/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux-Android/x86_64/libsqlitejdbc.so
index 0d52d982f..5450b6ba2 100755
Binary files a/src/main/resources/org/sqlite/native/Linux-Android/x86_64/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux-Android/x86_64/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux-Musl/aarch64/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux-Musl/aarch64/libsqlitejdbc.so
index 556e92613..e8158ad92 100755
Binary files a/src/main/resources/org/sqlite/native/Linux-Musl/aarch64/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux-Musl/aarch64/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux-Musl/x86/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux-Musl/x86/libsqlitejdbc.so
index 4119e2413..73611e7b3 100755
Binary files a/src/main/resources/org/sqlite/native/Linux-Musl/x86/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux-Musl/x86/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux-Musl/x86_64/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux-Musl/x86_64/libsqlitejdbc.so
index 46008361b..96e5efc6e 100755
Binary files a/src/main/resources/org/sqlite/native/Linux-Musl/x86_64/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux-Musl/x86_64/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux/aarch64/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux/aarch64/libsqlitejdbc.so
index 92d5cd3ad..9f1846035 100755
Binary files a/src/main/resources/org/sqlite/native/Linux/aarch64/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux/aarch64/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux/arm/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux/arm/libsqlitejdbc.so
index da9ba6c57..e987e8d67 100755
Binary files a/src/main/resources/org/sqlite/native/Linux/arm/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux/arm/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux/armv6/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux/armv6/libsqlitejdbc.so
index c542a01f2..c84c35be6 100755
Binary files a/src/main/resources/org/sqlite/native/Linux/armv6/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux/armv6/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux/armv7/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux/armv7/libsqlitejdbc.so
index 7b348477c..6549e88e8 100755
Binary files a/src/main/resources/org/sqlite/native/Linux/armv7/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux/armv7/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux/ppc64/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux/ppc64/libsqlitejdbc.so
index d9f6c392a..f3821486f 100755
Binary files a/src/main/resources/org/sqlite/native/Linux/ppc64/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux/ppc64/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux/x86/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux/x86/libsqlitejdbc.so
index 290aa05db..4bb620815 100644
Binary files a/src/main/resources/org/sqlite/native/Linux/x86/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux/x86/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Linux/x86_64/libsqlitejdbc.so b/src/main/resources/org/sqlite/native/Linux/x86_64/libsqlitejdbc.so
index a5ffc3ec3..fec0b3902 100644
Binary files a/src/main/resources/org/sqlite/native/Linux/x86_64/libsqlitejdbc.so and b/src/main/resources/org/sqlite/native/Linux/x86_64/libsqlitejdbc.so differ
diff --git a/src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.jnilib b/src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.jnilib
index 59e515bd9..0c8f864d5 100755
Binary files a/src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.jnilib and b/src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.jnilib differ
diff --git a/src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib b/src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib
index ca2fc0747..471f75aca 100755
Binary files a/src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib and b/src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib differ
diff --git a/src/main/resources/org/sqlite/native/Windows/aarch64/sqlitejdbc.dll b/src/main/resources/org/sqlite/native/Windows/aarch64/sqlitejdbc.dll
index a6f4a76e6..3778ddad8 100755
Binary files a/src/main/resources/org/sqlite/native/Windows/aarch64/sqlitejdbc.dll and b/src/main/resources/org/sqlite/native/Windows/aarch64/sqlitejdbc.dll differ
diff --git a/src/main/resources/org/sqlite/native/Windows/armv7/sqlitejdbc.dll b/src/main/resources/org/sqlite/native/Windows/armv7/sqlitejdbc.dll
index 5ce635f13..a10dde9bd 100755
Binary files a/src/main/resources/org/sqlite/native/Windows/armv7/sqlitejdbc.dll and b/src/main/resources/org/sqlite/native/Windows/armv7/sqlitejdbc.dll differ
diff --git a/src/main/resources/org/sqlite/native/Windows/x86/sqlitejdbc.dll b/src/main/resources/org/sqlite/native/Windows/x86/sqlitejdbc.dll
index ea03a56dd..3ad8b9820 100755
Binary files a/src/main/resources/org/sqlite/native/Windows/x86/sqlitejdbc.dll and b/src/main/resources/org/sqlite/native/Windows/x86/sqlitejdbc.dll differ
diff --git a/src/main/resources/org/sqlite/native/Windows/x86_64/sqlitejdbc.dll b/src/main/resources/org/sqlite/native/Windows/x86_64/sqlitejdbc.dll
index c488299cf..149ab4f67 100755
Binary files a/src/main/resources/org/sqlite/native/Windows/x86_64/sqlitejdbc.dll and b/src/main/resources/org/sqlite/native/Windows/x86_64/sqlitejdbc.dll differ
diff --git a/src/test/java/org/sqlite/DBMetaDataTest.java b/src/test/java/org/sqlite/DBMetaDataTest.java
index b3d20051d..17fc5151d 100644
--- a/src/test/java/org/sqlite/DBMetaDataTest.java
+++ b/src/test/java/org/sqlite/DBMetaDataTest.java
@@ -19,6 +19,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledInNativeImage;
/** These tests are designed to stress Statements on memory databases. */
public class DBMetaDataTest {
@@ -1563,6 +1564,7 @@ public void getIndexInfoIndexedMulti() throws SQLException {
}
@Test
+ @DisabledInNativeImage // assertj Assumptions do not work in native-image tests
public void version() throws Exception {
assumeThat(Utils.getCompileOptions(conn))
.as("Can't check the version if not compiled by us")
diff --git a/src/test/java/org/sqlite/ErrorMessageTest.java b/src/test/java/org/sqlite/ErrorMessageTest.java
index dcaca225c..50a307f73 100644
--- a/src/test/java/org/sqlite/ErrorMessageTest.java
+++ b/src/test/java/org/sqlite/ErrorMessageTest.java
@@ -11,8 +11,10 @@
import java.sql.SQLException;
import java.sql.Statement;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledInNativeImage;
import org.sqlite.core.DB;
+@DisabledInNativeImage // assertj Assumptions do not work in native-image tests
public class ErrorMessageTest {
@Test
public void moved() throws SQLException, IOException {
diff --git a/src/test/java/org/sqlite/ExtensionTest.java b/src/test/java/org/sqlite/ExtensionTest.java
index 2b0f6117b..a79cd868e 100644
--- a/src/test/java/org/sqlite/ExtensionTest.java
+++ b/src/test/java/org/sqlite/ExtensionTest.java
@@ -10,6 +10,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledInNativeImage;
public class ExtensionTest {
Connection conn;
@@ -62,6 +63,7 @@ public void extFTS5() throws Exception {
}
@Test
+ @DisabledInNativeImage // assertj Assumptions do not work in native-image tests
public void extFunctions() throws Exception {
Utils.assumeJdbcExtensions(conn);
@@ -74,6 +76,7 @@ public void extFunctions() throws Exception {
}
@Test
+ @DisabledInNativeImage // assertj Assumptions do not work in native-image tests
public void dbstat() throws Exception {
assumeThat(Utils.getCompileOptions(conn))
.as("SQLite has to be compiled with ENABLE_DBSTAT_VTAB")
diff --git a/src/test/java/org/sqlite/MathFunctionsTest.java b/src/test/java/org/sqlite/MathFunctionsTest.java
index f58faa2ed..c873c7e82 100644
--- a/src/test/java/org/sqlite/MathFunctionsTest.java
+++ b/src/test/java/org/sqlite/MathFunctionsTest.java
@@ -11,7 +11,9 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledInNativeImage;
+@DisabledInNativeImage // assertj Assumptions do not work in native-image tests
public class MathFunctionsTest {
private Connection conn;
private Statement stat;
diff --git a/src/test/java/org/sqlite/util/OSInfoTest.java b/src/test/java/org/sqlite/util/OSInfoTest.java
index a6e05161f..5e8befa8e 100644
--- a/src/test/java/org/sqlite/util/OSInfoTest.java
+++ b/src/test/java/org/sqlite/util/OSInfoTest.java
@@ -20,12 +20,14 @@
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
+import org.junit.jupiter.api.condition.DisabledInNativeImage;
import org.junitpioneer.jupiter.SetSystemProperty;
@DisabledIfEnvironmentVariable(
named = "SKIP_TEST_OSINFO",
matches = "true",
disabledReason = "Those tests would fail when ran on a musl based Linux")
+@DisabledInNativeImage
public class OSInfoTest {
private static final Logger logger = Logger.getLogger(OSInfoTest.class.getName());
diff --git a/src/test/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json b/src/test/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json
new file mode 100644
index 000000000..14a92481a
--- /dev/null
+++ b/src/test/resources/META-INF/native-image/org.xerial/sqlite-jdbc/reflect-config.json
@@ -0,0 +1,15 @@
+[
+ {
+ "name": "com.sun.rowset.providers.RIOptimisticProvider",
+ "methods": [
+ {
+ "name": "",
+ "parameterTypes": []
+ }
+ ]
+ },
+ {
+ "name": "java.sql.Types",
+ "allPublicFields": true
+ }
+]
\ No newline at end of file
diff --git a/src/test/resources/META-INF/native-image/org.xerial/sqlite-jdbc/resource-config.json b/src/test/resources/META-INF/native-image/org.xerial/sqlite-jdbc/resource-config.json
new file mode 100644
index 000000000..e4deda9b6
--- /dev/null
+++ b/src/test/resources/META-INF/native-image/org.xerial/sqlite-jdbc/resource-config.json
@@ -0,0 +1,17 @@
+{
+ "resources": {
+ "includes": [
+ {
+ "pattern": "^org/sqlite/.+\\.(jar|db)$"
+ },
+ {
+ "pattern": "\\Qjavax/sql/rowset/rowset.properties\\E"
+ }
+ ]
+ },
+ "bundles": [
+ {
+ "name": "com.sun.rowset.RowSetResourceBundle"
+ }
+ ]
+}
\ No newline at end of file