Unable to open the database file (out of memory)

5,578 views
Skip to first unread message

hgk

unread,
Jun 23, 2010, 1:27:52 PM6/23/10
to Xerial
Hi All,

I got the following exception.
java.sql.SQLException: [SQLITE_CANTOPEN] Unable to open the database
file (out of memory)
at org.sqlite.DB.throwex(DB.java:386)
at org.sqlite.NativeDB._open(Native Method)
at org.sqlite.DB.open(DB.java:91)
at org.sqlite.Conn.<init>(Conn.java:149)
at org.sqlite.Conn.<init>(Conn.java:49)
at org.sqlite.JDBC.connect(JDBC.java:86)
at
java.sql.DriverManager.getConnection(DriverManager.java:582)
at
java.sql.DriverManager.getConnection(DriverManager.java:185)

when I call
DriverManager.getConnection("jdbc:sqlite:/"+path,"","");

It happened only once with the db of size 156.8 MB

How do I prevent this in the future?

Thanks,
Bindu

Taro L. Saito

unread,
Jun 23, 2010, 7:44:16 PM6/23/10
to xer...@googlegroups.com
Hi,

Usually, SQLITE_CANTOPEN error means you can't open the database file,
for example, the path is wrong, or you don't have correct permission
(read/write) to open the file, etc.

In addition, sqlite has to write xxx.journal file in the same folder
with the database file, so
you also need a write permission to the folder of your database files.

The error message "out of memory" is observed when the program fails
to find/open database files. Something strange about SQLite is it
returns such a message even if it's not actually running out of the
memory.

--
Taro L. Saito
<l...@xerial.org>
University of Tokyo
http://www.xerial.org/leo
Tel. +81-47-136-3985 (63985)


On Thu, Jun 24, 2010 at 2:27 AM, hgk <hko...@yahoo.com> wrote:
> SQLITE_CANTOPEN

Jalpesh Rajani

unread,
Dec 12, 2014, 5:53:31 AM12/12/14
to xer...@googlegroups.com
I encountered this issue when I was creating a number of parallel connections and not closing them. Resultset.close() might ensure you do not run across this issue.
Reply all
Reply to author
Forward
0 new messages