LuaSQL connections closing

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

LuaSQL connections closing

Vadi
Has anyone who has used LuaSQL ran into a problem where open connections get involuntarily closed? I keep a connection open per database and only close them on application exit - yet on some machines :execute() statements start failing due to the connection being closed ("calling 'execute' on bad self (LuaSQL: connection is closed)>"). 

This hasn't happened in several years on a development machine, so I'm not sure what exactly triggers it yet, and whenever the problem is in LuaSQL or SQLite yet.

Any insights would be appreciated. Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: LuaSQL connections closing

Scott Morgan
On 20/05/13 06:11, Vadim Peretokin wrote:
> Has anyone who has used LuaSQL <http://www.keplerproject.org/luasql/>
> ran into a problem where open connections get involuntarily closed? I
> keep a connection open per database and only close them on application
> exit - yet on some machines :execute() statements start failing due to
> the connection being closed (/"calling 'execute' on bad self (LuaSQL:
> connection is closed)>/").

As far as I can see on the LuaSQL SQLite drivers, the only ways to get
that message is to call the connection:close() method or have the
connection garbage collected (held in a weak table?)

It would be nice to be able to edit the connection's metatable so you
can trace when those events happen but LuaSQL locks it as standard.

Scott