walterDurin / sqlite-jdbc

Automatically exported from code.google.com/p/sqlite-jdbc
Apache License 2.0
0 stars 0 forks source link

NullPointerException in pure java jdbc in multithread app #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by Pavel.Pa...@gmail.com on 8 Feb 2012 at 6:03

Attachments:

GoogleCodeExporter commented 9 years ago
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)

Original comment by Pavel.Pa...@gmail.com on 8 Feb 2012 at 6:50

GoogleCodeExporter commented 9 years ago
It's database I'm using.

Original comment by Pavel.Pa...@gmail.com on 8 Feb 2012 at 7:03

Attachments: