When using Berkeley DB 6.1.19. with Java API (JNI) there is a bug that prevents users from calling "Environment.lockVector()":
Setting a lock timeout for the LockRequest and defining "LockRequestMode.GET_TIMEOUT" is not correctly mapped in the JNI implementation. Instead of setting "timeout", "op" is getting set. I found the error and fixed it for my local Installation:
source file: lang/java/libdb_java/db_java_wrap.c line 1868 (Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1vec):
wrong:
case DB_LOCK_GET_TIMEOUT:
/* Needed: mode, timeout, obj. Returned: lock. */
prereq->op = (db_lockop_t)(*jenv)->GetIntField(
jenv, jlockreq, lockreq_timeout_fid);
must be fixed to:
prereq->timeout = (db_lockop_t)(*jenv)->GetIntField(
jenv, jlockreq, lockreq_timeout_fid);