Dear Sqlite Team, Thanks for looking into this mail. I am using sqlite database in my Android application with some native code. The database is shared between Android Application & Native code.
Can you please tell me the ideal behavior in below flow, In my Android application below native function is called through JNI, Native Layer: (JNI) . //Pseudocode jstring Java_com_example_MainActivity_callFromJavaToJNI() { sqlite3_open(“/data/…/MY_DATABASE_NAME”, &db); sqlite3_mutex* mutex; mutex = sqlite3_db_mutex(db); sqlite3_mutex_enter(mutex); //DATABASE LOCKED, So nobody should be able to access this database until its closed gracefully right??? sqlite3_exec(db, ….) // Sleep OR Wait for some time for testing the DB in Application Layer sleep(120); // wait() sqlite3_mutex_leave(mutex); sqlite3_close(db); } When the Native code is in waiting (or in sleep(120)), if Application tries to update the same Database. Whats should be the ideal behavior? I found that even after mutex lock in native, Application is still able to access the database (which is not released in native layer). Ideally when the database is locked, it should not be accessed from anywhere right? Is there something wrong with my native code in mutex lock? If the above code is fine, then why does the mutex lock initiated at native level not getting reflected at Application level? Thanks in advance. Warm Regards, Ajay Gaonkar _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users