walterDurin / sqlite-jdbc

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

Non-closed ResultSet causes readonly DB locked! #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
--------------------------------------
1. Get a readonly connection to the database.
2. Perform a SELECT query and do not invoke close() method of the result set.
3. Hang the process with a call to System.in.read() 
4. Try to update the DB with sqlite3 command lien util. 

What is the expected output? What do you see instead?
-----------------------------------------------------
It is expected that sqlite3 should be able to update the DB. But, sqlite3 
reports the database is locked. 
If you invoked close() method of the result set before hanging the process, the 
db is not locked anymore.

For a readonly connection, result set should not cause DB locked. Otherwise, 
what is the meaning of readonly connection? I guess this is a bug.

What version of the product are you using? On what operating system?
--------------------------------------------------------------------
Windows & Linux
The latest snapshort of 3.7.6.3.

Please provide any additional information below.
-------------------------------------------------
Code snipset to help reproduce the problem is attached.

Original issue reported on code.google.com by SemigodK...@gmail.com on 14 Jul 2011 at 5:46

Attachments:

GoogleCodeExporter commented 9 years ago
Moved to bitbucket: https://bitbucket.org/xerial/sqlite-jdbc/issue/21/

Original comment by Grace.Ba...@gmail.com on 12 Sep 2012 at 2:40

GoogleCodeExporter commented 9 years ago
This is by design http://www.sqlite.org/atomiccommit.html#rdlck. 
Note that when it comes to a JDBC resultset, a read is not complete until, the 
result set is closed.

Original comment by Grace.Ba...@gmail.com on 26 Nov 2012 at 12:37

GoogleCodeExporter commented 9 years ago

Original comment by Grace.Ba...@gmail.com on 26 Nov 2012 at 12:37