Re: [sqlite] (How) can I test for an open transaction?

2011-03-02 Thread Jay A. Kreibich
On Wed, Mar 02, 2011 at 12:37:44PM -0500, Pavel Ivanov scratched on the wall: > I believe sqlite3_get_autocommit is what you need: > http://www.sqlite.org/c3ref/get_autocommit.html. Yes. More specifically, if you *are* in auto-commit mode, then by definition you are NOT in an explicit transac

Re: [sqlite] (How) can I test for an open transaction?

2011-03-02 Thread Simon Slavin
On 2 Mar 2011, at 5:32pm, Philip Graham Willoughby wrote: > I would like to close the database connection if it is safe to do so when my > app is suspended, so that the -wal file can be erased saving the user some > space, and also because I hear that improves the efficiency of subsequent > qu

Re: [sqlite] (How) can I test for an open transaction?

2011-03-02 Thread Pavel Ivanov
I believe sqlite3_get_autocommit is what you need: http://www.sqlite.org/c3ref/get_autocommit.html. Pavel On Wed, Mar 2, 2011 at 12:32 PM, Philip Graham Willoughby wrote: > Hi all, > > I use SQLite in an iPhone application, and for my own convenience I have > wrapped it up in an object-oriente

Re: [sqlite] (How) can I test for an open transaction?

2011-03-02 Thread Mickey Mestel
phil, i think the easiest way is more or less like you said. issue the BEGIN, and if you get an ok back, you aren't in a transaction, so you just commit and close the db. otherwise you can wait and check later. there may be a better way do it, but that is all i know of.

[sqlite] (How) can I test for an open transaction?

2011-03-02 Thread Philip Graham Willoughby
Hi all, I use SQLite in an iPhone application, and for my own convenience I have wrapped it up in an object-oriented wrapper of my own devising. I would like to close the database connection if it is safe to do so when my app is suspended, so that the -wal file can be erased saving the user som