You CANNOT cache the JNIEnv and should be using AttachCurrentThread() on the cached JVM*. If the native thread is already attached I believe this function is equivalent to a NOOP.
if ((*jvm)->AttachCurrentThread(jvm, (void **)(&env), NULL) == JNI_OK) {
....
}