Skip to content

Commit 000bc11

Browse files
committed
Force HAWTJNI strategy of temp instead of sha1
sha1 strategy is made only to support single dll and can't work when you have dependent libraries.
1 parent ece36de commit 000bc11

File tree

1 file changed

+88
-85
lines changed
  • mdbxjni/src/main/java/com/castortech/mdbxjni

1 file changed

+88
-85
lines changed

mdbxjni/src/main/java/com/castortech/mdbxjni/JNI.java

+88-85
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public class JNI {
3838
public static final Library JNI_LIB = new Library("mdbxjni", JNI.class); //$NON-NLS-1$
3939

4040
static {
41+
//Needed to avoid java.lang.UnsatisfiedLinkError: Can't find dependent libraries
42+
//The sha1 strategy on windows will prohibit the JNI lib to find the DB lib.
43+
System.setProperty("hawtjni.strategy", "temp"); //$NON-NLS-1$ //$NON-NLS-2$
4144
JNI.DB_LIB.load();
4245
JNI.JNI_LIB.load();
4346
init();
@@ -145,18 +148,18 @@ public static class MDBX_version_info {
145148
@SuppressWarnings("nls")
146149
@Override
147150
public String toString() {
148-
return "{" +
149-
"major=" + major +
150-
", minor=" + minor +
151-
", release=" + release +
152-
", revision=" + revision +
151+
return "{" + //$NON-NLS-1$
152+
"major=" + major + //$NON-NLS-1$
153+
", minor=" + minor + //$NON-NLS-1$
154+
", release=" + release + //$NON-NLS-1$
155+
", revision=" + revision + //$NON-NLS-1$
153156
// ", git=" + git +
154157
'}';
155158
}
156159

157160
@SuppressWarnings("nls")
158161
public String getVersionString() {
159-
return "" + major + '.' + minor + '.' + release + '.' + revision;
162+
return "" + major + '.' + minor + '.' + release + '.' + revision; //$NON-NLS-1$
160163
}
161164
}
162165

@@ -182,12 +185,12 @@ public static class MDBX_build_info {
182185
@SuppressWarnings("nls")
183186
@Override
184187
public String toString() {
185-
return "{" +
186-
"datetime=" + new String(datetime) +
187-
", target=" + new String(target) +
188-
", options=" + new String(options) +
189-
", compiler=" + new String(compiler) +
190-
", flags=" + new String(flags) +
188+
return "{" + //$NON-NLS-1$
189+
"datetime=" + new String(datetime) + //$NON-NLS-1$
190+
", target=" + new String(target) + //$NON-NLS-1$
191+
", options=" + new String(options) + //$NON-NLS-1$
192+
", compiler=" + new String(compiler) + //$NON-NLS-1$
193+
", flags=" + new String(flags) + //$NON-NLS-1$
191194
'}';
192195
}
193196
}
@@ -217,15 +220,15 @@ public static class MDBX_txn_info {
217220
@SuppressWarnings("nls")
218221
@Override
219222
public String toString() {
220-
return "{" +
221-
"txn_id=" + txn_id +
222-
", txn_reader_lag=" + txn_reader_lag +
223-
", txn_space_used=" + txn_space_used +
224-
", txn_space_limit_soft=" + txn_space_limit_soft +
225-
", txn_space_limit_hard=" + txn_space_limit_hard +
226-
", txn_space_retired=" + txn_space_retired +
227-
", txn_space_leftover=" + txn_space_leftover +
228-
", txn_space_dirty=" + txn_space_dirty +
223+
return "{" + //$NON-NLS-1$
224+
"txn_id=" + txn_id + //$NON-NLS-1$
225+
", txn_reader_lag=" + txn_reader_lag + //$NON-NLS-1$
226+
", txn_space_used=" + txn_space_used + //$NON-NLS-1$
227+
", txn_space_limit_soft=" + txn_space_limit_soft + //$NON-NLS-1$
228+
", txn_space_limit_hard=" + txn_space_limit_hard + //$NON-NLS-1$
229+
", txn_space_retired=" + txn_space_retired + //$NON-NLS-1$
230+
", txn_space_leftover=" + txn_space_leftover + //$NON-NLS-1$
231+
", txn_space_dirty=" + txn_space_dirty + //$NON-NLS-1$
229232
'}';
230233
}
231234
}
@@ -253,14 +256,14 @@ public static class MDBX_commit_latency {
253256
@SuppressWarnings("nls")
254257
@Override
255258
public String toString() {
256-
return "{" +
257-
"preparation=" + preparation +
258-
", gc=" + gc +
259-
", audit=" + audit +
260-
", write=" + write +
261-
", sync=" + sync +
262-
", ending=" + ending +
263-
", whole=" + whole +
259+
return "{" + //$NON-NLS-1$
260+
"preparation=" + preparation + //$NON-NLS-1$
261+
", gc=" + gc + //$NON-NLS-1$
262+
", audit=" + audit + //$NON-NLS-1$
263+
", write=" + write + //$NON-NLS-1$
264+
", sync=" + sync + //$NON-NLS-1$
265+
", ending=" + ending + //$NON-NLS-1$
266+
", whole=" + whole + //$NON-NLS-1$
264267
'}';
265268
}
266269
}
@@ -282,11 +285,11 @@ public static class MDBX_canary {
282285
@SuppressWarnings("nls")
283286
@Override
284287
public String toString() {
285-
return "{" +
286-
"x=" + x +
287-
", y=" + y +
288-
", z=" + z +
289-
", v=" + v +
288+
return "{" + //$NON-NLS-1$
289+
"x=" + x + //$NON-NLS-1$
290+
", y=" + y + //$NON-NLS-1$
291+
", z=" + z + //$NON-NLS-1$
292+
", v=" + v + //$NON-NLS-1$
290293
'}';
291294
}
292295
}
@@ -778,49 +781,49 @@ public static class MDBX_envinfo {
778781
@SuppressWarnings("nls")
779782
@Override
780783
public String toString() {
781-
return "{" +
782-
"mi_geo_lower=" + mi_geo_lower +
783-
", mi_geo_upper=" + mi_geo_upper +
784-
", mi_geo_current=" + mi_geo_current +
785-
", mi_geo_shrink=" + mi_geo_shrink +
786-
", mi_geo_grow=" + mi_geo_grow +
787-
", mi_mapsize=" + mi_mapsize +
788-
", mi_last_pgno=" + mi_last_pgno +
789-
", mi_recent_txnid=" + mi_recent_txnid +
790-
", mi_latter_reader_txnid=" + mi_latter_reader_txnid +
791-
", mi_self_latter_reader_txnid=" + mi_self_latter_reader_txnid +
792-
", mi_meta0_txnid=" + mi_meta0_txnid +
793-
", mi_meta0_sign=" + mi_meta0_sign +
794-
", mi_meta1_txnid=" + mi_meta1_txnid +
795-
", mi_meta1_sign=" + mi_meta1_sign +
796-
", mi_meta2_txnid=" + mi_meta2_txnid +
797-
", mi_meta2_sign=" + mi_meta2_sign +
798-
", mi_maxreaders=" + mi_maxreaders +
799-
", mi_numreaders=" + mi_numreaders +
800-
", mi_dxb_pagesize=" + mi_dxb_pagesize +
801-
", mi_sys_pagesize=" + mi_sys_pagesize +
802-
", mi_bootid_current_x=" + mi_bootid_current_x +
803-
", mi_bootid_current_y=" + mi_bootid_current_y +
804-
", mi_bootid_meta0_x=" + mi_bootid_meta0_x +
805-
", mi_bootid_meta0_y=" + mi_bootid_meta0_y +
806-
", mi_bootid_meta1_x=" + mi_bootid_meta1_x +
807-
", mi_bootid_meta1_y=" + mi_bootid_meta1_y +
808-
", mi_bootid_meta2_x=" + mi_bootid_meta2_x +
809-
", mi_bootid_meta2_y=" + mi_bootid_meta2_y +
810-
", mi_unsync_volume=" + mi_unsync_volume +
811-
", mi_autosync_threshold=" + mi_autosync_threshold +
812-
", mi_since_sync_seconds16dot16=" + mi_since_sync_seconds16dot16 +
813-
", mi_autosync_period_seconds16dot16=" + mi_autosync_period_seconds16dot16 +
814-
", mi_since_reader_check_seconds16dot16=" + mi_since_reader_check_seconds16dot16 +
815-
", mi_mode=" + mi_mode +
816-
", mi_pgop_stat_newly=" + mi_pgop_stat_newly +
817-
", mi_pgop_stat_cow=" + mi_pgop_stat_cow +
818-
", mi_pgop_stat_clone=" + mi_pgop_stat_clone +
819-
", mi_pgop_stat_split=" + mi_pgop_stat_split +
820-
", mi_pgop_stat_merge=" + mi_pgop_stat_merge +
821-
", mi_pgop_stat_spill=" + mi_pgop_stat_spill +
822-
", mi_pgop_stat_unspill=" + mi_pgop_stat_unspill +
823-
", mi_pgop_stat_wops=" + mi_pgop_stat_wops +
784+
return "{" + //$NON-NLS-1$
785+
"mi_geo_lower=" + mi_geo_lower + //$NON-NLS-1$
786+
", mi_geo_upper=" + mi_geo_upper + //$NON-NLS-1$
787+
", mi_geo_current=" + mi_geo_current + //$NON-NLS-1$
788+
", mi_geo_shrink=" + mi_geo_shrink + //$NON-NLS-1$
789+
", mi_geo_grow=" + mi_geo_grow + //$NON-NLS-1$
790+
", mi_mapsize=" + mi_mapsize + //$NON-NLS-1$
791+
", mi_last_pgno=" + mi_last_pgno + //$NON-NLS-1$
792+
", mi_recent_txnid=" + mi_recent_txnid + //$NON-NLS-1$
793+
", mi_latter_reader_txnid=" + mi_latter_reader_txnid + //$NON-NLS-1$
794+
", mi_self_latter_reader_txnid=" + mi_self_latter_reader_txnid + //$NON-NLS-1$
795+
", mi_meta0_txnid=" + mi_meta0_txnid + //$NON-NLS-1$
796+
", mi_meta0_sign=" + mi_meta0_sign + //$NON-NLS-1$
797+
", mi_meta1_txnid=" + mi_meta1_txnid + //$NON-NLS-1$
798+
", mi_meta1_sign=" + mi_meta1_sign + //$NON-NLS-1$
799+
", mi_meta2_txnid=" + mi_meta2_txnid + //$NON-NLS-1$
800+
", mi_meta2_sign=" + mi_meta2_sign + //$NON-NLS-1$
801+
", mi_maxreaders=" + mi_maxreaders + //$NON-NLS-1$
802+
", mi_numreaders=" + mi_numreaders + //$NON-NLS-1$
803+
", mi_dxb_pagesize=" + mi_dxb_pagesize + //$NON-NLS-1$
804+
", mi_sys_pagesize=" + mi_sys_pagesize + //$NON-NLS-1$
805+
", mi_bootid_current_x=" + mi_bootid_current_x + //$NON-NLS-1$
806+
", mi_bootid_current_y=" + mi_bootid_current_y + //$NON-NLS-1$
807+
", mi_bootid_meta0_x=" + mi_bootid_meta0_x + //$NON-NLS-1$
808+
", mi_bootid_meta0_y=" + mi_bootid_meta0_y + //$NON-NLS-1$
809+
", mi_bootid_meta1_x=" + mi_bootid_meta1_x + //$NON-NLS-1$
810+
", mi_bootid_meta1_y=" + mi_bootid_meta1_y + //$NON-NLS-1$
811+
", mi_bootid_meta2_x=" + mi_bootid_meta2_x + //$NON-NLS-1$
812+
", mi_bootid_meta2_y=" + mi_bootid_meta2_y + //$NON-NLS-1$
813+
", mi_unsync_volume=" + mi_unsync_volume + //$NON-NLS-1$
814+
", mi_autosync_threshold=" + mi_autosync_threshold + //$NON-NLS-1$
815+
", mi_since_sync_seconds16dot16=" + mi_since_sync_seconds16dot16 + //$NON-NLS-1$
816+
", mi_autosync_period_seconds16dot16=" + mi_autosync_period_seconds16dot16 + //$NON-NLS-1$
817+
", mi_since_reader_check_seconds16dot16=" + mi_since_reader_check_seconds16dot16 + //$NON-NLS-1$
818+
", mi_mode=" + mi_mode + //$NON-NLS-1$
819+
", mi_pgop_stat_newly=" + mi_pgop_stat_newly + //$NON-NLS-1$
820+
", mi_pgop_stat_cow=" + mi_pgop_stat_cow + //$NON-NLS-1$
821+
", mi_pgop_stat_clone=" + mi_pgop_stat_clone + //$NON-NLS-1$
822+
", mi_pgop_stat_split=" + mi_pgop_stat_split + //$NON-NLS-1$
823+
", mi_pgop_stat_merge=" + mi_pgop_stat_merge + //$NON-NLS-1$
824+
", mi_pgop_stat_spill=" + mi_pgop_stat_spill + //$NON-NLS-1$
825+
", mi_pgop_stat_unspill=" + mi_pgop_stat_unspill + //$NON-NLS-1$
826+
", mi_pgop_stat_wops=" + mi_pgop_stat_wops + //$NON-NLS-1$
824827
'}';
825828
}
826829
}
@@ -848,14 +851,14 @@ public static class MDBX_stat {
848851
@SuppressWarnings("nls")
849852
@Override
850853
public String toString() {
851-
return "{" +
852-
"ms_branch_pages=" + ms_branch_pages +
853-
", ms_psize=" + ms_psize +
854-
", ms_depth=" + ms_depth +
855-
", ms_leaf_pages=" + ms_leaf_pages +
856-
", ms_overflow_pages=" + ms_overflow_pages +
857-
", ms_entries=" + ms_entries +
858-
", ms_mod_txnid=" + ms_mod_txnid +
854+
return "{" + //$NON-NLS-1$
855+
"ms_branch_pages=" + ms_branch_pages + //$NON-NLS-1$
856+
", ms_psize=" + ms_psize + //$NON-NLS-1$
857+
", ms_depth=" + ms_depth + //$NON-NLS-1$
858+
", ms_leaf_pages=" + ms_leaf_pages + //$NON-NLS-1$
859+
", ms_overflow_pages=" + ms_overflow_pages + //$NON-NLS-1$
860+
", ms_entries=" + ms_entries + //$NON-NLS-1$
861+
", ms_mod_txnid=" + ms_mod_txnid + //$NON-NLS-1$
859862
'}';
860863
}
861864
}

0 commit comments

Comments
 (0)