Export to GitHub

sqlite-jdbc - issue #20

NullPointerException in pure java jdbc in multithread app


Posted on Feb 8, 2012 by Quick Bird

What steps will reproduce the problem?

I'm trying to use SQLiteJDBC in multiple threads and get next exception: java.lang.NullPointerException

I've created a small test file to reproduce the problem: see attached

What is the expected output? What do you see instead? I expect that no NullPointerException will be thrown, but it is: java.lang.NullPointerException at org.ibex.nestedvm.UnixRuntime.sys_fcntl_lock(UnixRuntime.java:807) at org.ibex.nestedvm.UnixRuntime._syscall(UnixRuntime.java:159) at org.ibex.nestedvm.Runtime.syscall(Runtime.java:1074) at org.sqlite.SQLite.run_0x171800(target/build/SQLite.mips) at org.sqlite.SQLite.trampoline(target/build/SQLite.mips) at org.sqlite.SQLite._execute(target/build/SQLite.mips) at org.ibex.nestedvm.Runtime.__execute(Runtime.java:506) at org.ibex.nestedvm.Runtime.call(Runtime.java:678) at org.ibex.nestedvm.Runtime.call(Runtime.java:647) at org.sqlite.NestedDB.call(NestedDB.java:568) at org.sqlite.NestedDB.call(NestedDB.java:563) at org.sqlite.NestedDB.prepare(NestedDB.java:130) at org.sqlite.DB.prepare(DB.java:123) at org.sqlite.Stmt.executeQuery(Stmt.java:121) at SQliteJDBSTest$1.run(SQliteJDBSTest.java:23) at java.lang.Thread.run(Unknown Source)

What version of the product are you using? On what operating system? 3.7.2 on Win7_64

Please provide any additional information below.

test1.db is SQlite3 db, which has table Map with several text fields

Attachments

Comment #1

Posted on Feb 8, 2012 by Quick Bird

It could be reproduced in java1.5 only - with java1.6 I've got exception: Caused by: java.sql.SQLException: [SQLITE_BUSY] The database file is locked (database is locked) at org.sqlite.DB.newSQLException(DB.java:383) at org.sqlite.DB.newSQLException(DB.java:387) at org.sqlite.DB.throwex(DB.java:374) at org.sqlite.NestedDB.prepare(NestedDB.java:134) at org.sqlite.DB.prepare(DB.java:123) at org.sqlite.Stmt.executeQuery(Stmt.java:121)

Comment #2

Posted on Feb 8, 2012 by Quick Bird

It's database I'm using.

Attachments

Status: New

Labels:
Type-Defect Priority-Medium AffectedVersion-3.7.x FixedVersion-NA