Re: [sqlite] sqlite3_close() drops wal and shm files despite of other processes holding DB open

2019-07-16 Thread Andreas Kretzer
Interessting insights! Dan pointed out, that I should check the locks on the DB files and report that information back. Unluckily, my 'lsof' just reports PIDs, executable name and open file. It is a Busybox multicall binary. The good thing is: I have 'lslocks' on my system, which gives me exactly

Re: [sqlite] sqlite3_close() drops wal and shm files despite of other processes holding DB open

2019-07-16 Thread Andreas Kretzer
... and here is the solution! I daemonize my programs using daemon (1, 1); If I do that, before I open the DB, then everything is alright, locks are held - fine! In the other case I was first opening the DB to fetch some configuration options from it before I took care of program args and t

Re: [sqlite] sqlite3_close() drops wal and shm files despite of other processes holding DB open

2019-07-16 Thread Andreas Kretzer
Interessting insights! Dan pointed out, that I should check the locks on the DB files and report that information back. Unluckily, my 'lsof' just reports PIDs, executable name and open file. It is a Busybox multicall binary. The good thing is: I have 'lslocks' on my system, which gives me exactly

Re: [sqlite] sqlite3_close() drops wal and shm files despite of other processes holding DB open

2019-07-12 Thread Dan Kennedy
On 11/7/62 23:07, Andreas Kretzer wrote: I'm using SQLITE3 (V3.29.0) on an arm embedded linux (2.6.39) on an ext3 filesystem. Several processes hold the DB open and the "-wal" and "-shm" files exist. if I use 'lsof | fgrep ' I can see all processes having all three files open. At least one of t

[sqlite] sqlite3_close() drops wal and shm files despite of other processes holding DB open

2019-07-11 Thread Andreas Kretzer
I'm using SQLITE3 (V3.29.0) on an arm embedded linux (2.6.39) on an ext3 filesystem. Several processes hold the DB open and the "-wal" and "-shm" files exist. if I use 'lsof | fgrep ' I can see all processes having all three files open. At least one of the processes uses threads, but every process

[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose

2016-04-14 Thread Cezary H. Noweta
Hello, On 2016-04-14 16:16, Dobrean, Adrian wrote: > Is xSync guaranteed to be called only once, same as for xClose, if it is then > from flush I/O point of view we should be almost no difference. No --- it is not guaranteed even once, as I described in previous post. > However still xClose rel

[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose

2016-04-14 Thread Cezary H. Noweta
Hello, On 2016-04-14 15:40, Richard Hipp wrote: > On 4/14/16, Dobrean, Adrian wrote: >> >> The problem is that when I close there are still I/O operations that >> sometimes need to happen, e.g. flush of some buffers, and I need to know if >> those operations finished successfully or not. > This

[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose

2016-04-14 Thread Dobrean, Adrian
users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Thursday, April 14, 2016 9:41 AM To: SQLite mailing list Subject: Re: [sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose On 4/14/16, Dobrean, Adrian wrote: > > The problem is that when I close there are stil

[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose

2016-04-14 Thread Dobrean, Adrian
t: Re: [sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose On 4/14/16, Dobrean, Adrian wrote: > > Is there a way or what should be the proper way to capture the error > returned by sqlite3_io_methods.xClose? > No. It looks like the

[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose

2016-04-14 Thread Dobrean, Adrian
Hi, It looks like the error returned by sqlite3_io_methods.xClose is not propagated all the way to sqlite3_close caller. According to a comment in sqlite3_close this function (excepting SQLITE_BUSY) always returns true. Is there a way or what should be the proper way to capture the error return

[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose

2016-04-14 Thread Richard Hipp
On 4/14/16, Dobrean, Adrian wrote: > > The problem is that when I close there are still I/O operations that > sometimes need to happen, e.g. flush of some buffers, and I need to know if > those operations finished successfully or not. This shouldn't ever come up. xSync should have been called to

[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose

2016-04-14 Thread Richard Hipp
On 4/14/16, Dobrean, Adrian wrote: > > I am not so sure why the error is discarded, Because (1) failure is impossible on most implementations of xClose and nearly so for the rest, and (2) propagating the error back up to the application would require a lot of code that needs to be written, tested

[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose

2016-04-14 Thread Richard Hipp
On 4/14/16, Dobrean, Adrian wrote: > > Is there a way or what should be the proper way to capture the error > returned by sqlite3_io_methods.xClose? > No. It looks like the return value from sqlite3_io_methods.xClose is always ignored and discarded. Why is that a problem? -- D. Richard Hipp d

Re: [sqlite] sqlite3_close() is failing

2013-07-05 Thread Ashok Pitambar
Yes you are right there were some unfinalized statements left.which were causing this problem. Thanks On Jul 5, 2013 4:42 PM, "Simon Slavin" wrote: ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sql

Re: [sqlite] sqlite3_close() is failing

2013-07-05 Thread Simon Slavin
On 5 Jul 2013, at 12:10pm, Ashok Pitambar wrote: > sqlite3_close() is failing with return value SQLITE_BUSY. what could > bethe reason for this? One possibility is that you have an open statement. In other words you have created a statement with sqlite3_prepare() but never got around to using

[sqlite] sqlite3_close() is failing

2013-07-05 Thread Ashok Pitambar
Hi All, sqlite3_close() is failing with return value SQLITE_BUSY. what could bethe reason for this? Thanks, Ashok ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] sqlite3_close() documentation inconsistency

2013-03-12 Thread Shane Harrelson
Documentation for sqlite3_close() on http://www.sqlite.org/c3ref/close.html has two conflicting statements: "If the database connection is associated with unfinalized prepared statements or unfinished sqlite3_backup objects then sqlite3_close() will leave the database connection open and return SQ

Re: [sqlite] sqlite3_close() blocked data base file

2012-02-10 Thread NOCaut2012
i think fixed:: http://synopse.info/forum/viewtopic.php?id=20 -- View this message in context: http://old.nabble.com/sqlite3_close%28%29-blocked-data-base-file-tp33292831p33300699.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlit

[sqlite] sqlite3_close() blocked data base file

2012-02-09 Thread NOCaut2012
Hi. maybe it is bug sqlite I'm not sure exactly. and decided to CREATE POST. for unknown reasons sqlite3_close() == SQLITE_BUSY, sqlite blocked data base file. I find on the forum next code: void CSQLiteDB::Close() { if(m_db) { sqlite3 *db = m_db; m_db = NULL;

Re: [sqlite] sqlite3_close() necessary?

2012-01-17 Thread Richard Hipp
On Tue, Jan 17, 2012 at 11:51 AM, Bill McCormick wrote: > What happens if my application fails to call sqlite3_close() before it > exits? Does it leave the db in some unknown state or open to corruption? > > If I have a daemon type program, will I need to catch signals that try to > close/kill the

[sqlite] sqlite3_close() necessary?

2012-01-17 Thread Bill McCormick
What happens if my application fails to call sqlite3_close() before it exits? Does it leave the db in some unknown state or open to corruption? If I have a daemon type program, will I need to catch signals that try to close/kill the program and call sqlite3_close() before exiting? Thanks!! __

Re: [sqlite] sqlite3_close( ) error

2011-03-24 Thread Marian Cascaval
From: Simon Slavin To: General Discussion of SQLite Database Sent: Thu, March 24, 2011 5:39:58 AM Subject: Re: [sqlite] sqlite3_close( ) error On 24 Mar 2011, at 3:06am, Zaryab M. Munir wrote: >By the way, to whoever understands the code on the

Re: [sqlite] sqlite3_close( ) error

2011-03-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/23/2011 08:06 PM, Zaryab M. Munir wrote: > I am consistently observing this error in Linux envrionment. > Wondering what can be wrong. By far the best thing to do is use valgrind. You'll immediately see who allocates and frees memory and when

Re: [sqlite] sqlite3_close( ) error

2011-03-23 Thread Simon Slavin
On 24 Mar 2011, at 3:06am, Zaryab M. Munir wrote: > Also, I must mention that if I call a different callback function which > doesn't do many calloc() etc. I don't see this error. Very good diagnostic. Can you compare your code with the C example on this page:

[sqlite] sqlite3_close( ) error

2011-03-23 Thread Zaryab M. Munir
Hi, I am consistently observing this error in Linux envrionment. I have sqlite3 library linked with my DLL. The program links/loads my DLL as well as a second DLL which includes the code to open and close db connections. Wondering what can be wrong. Below is description: sqlite3 *db; 1) I

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-25 Thread Jean-Denis Muys
On 2/24/10 19:19 , "D. Richard Hipp" wrote: > > On Feb 24, 2010, at 1:12 PM, Mike Shal wrote: >>> >>> This compiler is llvm. Check it out at http://llvm.org >>> You can test for this mistake on the demo page at http://llvm.org/ >>> demo >>> > > > FWIW, there are currently two places in SQLi

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-25 Thread Jean-Denis Muys
On 2/24/10 19:12 , "Mike Shal" wrote: > On 2/24/10, Jean-Denis Muys wrote: >> >> On 2/24/10 9:36 , "Simon Davies" wrote: >> >>> Rogue semicolon on line >>> if( sqlite3_close( db ) != SQLITE_OK ); >>> >>> Regards, >>> Simon >> >> >> I have been bitten by such silly mistakes often e

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-24 Thread D. Richard Hipp
On Feb 24, 2010, at 1:12 PM, Mike Shal wrote: >> >> This compiler is llvm. Check it out at http://llvm.org >> You can test for this mistake on the demo page at http://llvm.org/ >> demo >> FWIW, there are currently two places in SQLite where we have had to complicate the code in order to work

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-24 Thread Mike Shal
On 2/24/10, Jean-Denis Muys wrote: > > On 2/24/10 9:36 , "Simon Davies" wrote: > > > Rogue semicolon on line > > > >> if( sqlite3_close( db ) != SQLITE_OK ); > > > > Regards, > > Simon > > > I have been bitten by such silly mistakes often enough! > > This is why I have switched to a comp

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-24 Thread newlog
I CAN'T BELIEVE I'VE DONE THIS !!! I must be so stupid that I've spent days wondering why. Thank you so much Simon for your very advised look on my code. I deeply apologize for polluting that forum with such a silly mistake. Regards Very well done Simon !! On Feb 24, 9:54 am, Jean-Denis M

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-24 Thread Jean-Denis Muys
On 2/24/10 9:36 , "Simon Davies" wrote: > On 23 February 2010 17:44, newlog wrote: >> OK, >> >> I really don't understand >> > > Rogue semicolon on line > >>  if( sqlite3_close( db ) != SQLITE_OK ); > > Regards, > Simon I have been bitten by such silly mistakes often enough! This is

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-24 Thread Simon Davies
On 23 February 2010 17:44, newlog wrote: > OK, > > With the following code : > > - > > sqlite3        *db = NULL; > >  if( sqlite3_open( "D:\Test3.db", &db) != SQLITE_OK ) >       { >        // Exit if error while opening. >        wxMessageBox( wxSt

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread Simon Slavin
On 23 Feb 2010, at 10:06pm, Simon Slavin wrote: > Change the two error messages so the first one has a '1' in it and the second > one has a '2' in it. Then run it again and tell us which of the two error > messages is being shown. Ignore that. I got confused. Heh heh. Simon. __

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread Simon Slavin
On 23 Feb 2010, at 5:44pm, newlog wrote: > With the following code : > > - > > sqlite3*db = NULL; > > if( sqlite3_open( "D:\Test3.db", &db) != SQLITE_OK ) > { >// Exit if error while opening. >wxMessageBox( wxString

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread newlog
OK, With the following code : - sqlite3*db = NULL; if( sqlite3_open( "D:\Test3.db", &db) != SQLITE_OK ) { // Exit if error while opening. wxMessageBox( wxString( "Error while opening :\n") << sqlite3_errmsg(db) );

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread Simon Davies
On 23 February 2010 16:46, newlog wrote: > Hi Simon, > > Thanx for your answer, > > > IN case of error when trying to open the file, we close db pointer and > exit the sub-routine ( return keyword follows closing ). > > So 'sqlite3_close' can't be called twice. My point was that if the database o

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread newlog
Hi Simon, Thanx for your answer, IN case of error when trying to open the file, we close db pointer and exit the sub-routine ( return keyword follows closing ). So 'sqlite3_close' can't be called twice. Sincerely, John On Feb 23, 2:40 pm, Simon Davies wrote: > On 23 February 2010 12:51, J

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread Nick Shaw
rror? Nick. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of John Sent: 23 February 2010 10:17 To: sqlite-users@sqlite.org Subject: [sqlite] sqlite3_close ==> " library routine called out of sequence" Hi All, Th

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread Simon Davies
On 23 February 2010 12:51, John wrote: > Forgot to say that the error occurs at the sqlite3_close   function. > > John > >> The very simple C-code below returns error message " library routine >> called out of sequence" . >> I really don't understand why  ? >> >> I'm using SQLite 3.6.22 under Wind

Re: [sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread John
Forgot to say that the error occurs at the sqlite3_close function. John On Feb 23, 11:17 am, John wrote: > Hi All, > > The very simple C-code below returns error message " library routine > called out of sequence" . > I really don't understand why  ? > > I'm using SQLite 3.6.22 under Windows X

[sqlite] sqlite3_close ==> " library routine called out of sequence"

2010-02-23 Thread John
Hi All, The very simple C-code below returns error message " library routine called out of sequence" . I really don't understand why ? I'm using SQLite 3.6.22 under Windows XP Any idea/suggestion would be really appreciated ! --

Re: [sqlite] sqlite3_close

2008-08-22 Thread Dennis Cote
Joanne Pham wrote: > Hi Igor, > I used SQLite versio n 3.5.9. > I read the SQLite online document and the suggession that we need to finalize > all the prepare statement associated with database connection before closing > the connection as below > > while( (pStmt = sqlite3_next_stmt(pD

Re: [sqlite] sqlite3_close

2008-08-21 Thread Joanne Pham
te.org Sent: Thursday, August 21, 2008 1:52:15 PM Subject: Re: [sqlite] sqlite3_close Joanne Pham <[EMAIL PROTECTED]> wrote: > Is it necessary to call only sqlite3_close(pDb) before open another > connection. Thanks, No (though it's not clear why you would want multiple connections

Re: [sqlite] sqlite3_close

2008-08-21 Thread Joanne Pham
Got it! Thanks a lot for your answer. JP. - Original Message From: Igor Tandetnik <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Thursday, August 21, 2008 1:52:15 PM Subject: Re: [sqlite] sqlite3_close Joanne Pham <[EMAIL PROTECTED]> wrote: > Is it necessa

Re: [sqlite] sqlite3_close

2008-08-21 Thread Igor Tandetnik
Joanne Pham <[EMAIL PROTECTED]> wrote: > Is it necessary to call only sqlite3_close(pDb) before open another > connection. Thanks, No (though it's not clear why you would want multiple connections open at the same time). You can open several connections and close them in any order. But in your

Re: [sqlite] sqlite3_close

2008-08-21 Thread Joanne Pham
Is it necessary to call only sqlite3_close(pDb) before open another connection. Thanks, JP - Original Message From: Igor Tandetnik <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Thursday, August 21, 2008 12:03:58 PM Subject: Re: [sqlite] sqlite3_close Joanne Pham &

Re: [sqlite] sqlite3_close

2008-08-21 Thread Mihai Limbasan
Mihai Limbasan wrote: Hello there. I've re-read your mail a few times, however you seem to have forgotten to actually *ask the question.* On a sidenote, though: You're storing the database connection in a local variable (sqlSt) instead of returning it - so when you return from the function,

Re: [sqlite] sqlite3_close

2008-08-21 Thread Mihai Limbasan
Hello there. I've re-read your mail a few times, however you seem to have forgotten to actually *ask the question.* On a sidenote, though: You're storing the database connection in a local variable (sqlSt) instead of returning it - so when you return from the function, you've opened a connec

Re: [sqlite] sqlite3_close

2008-08-21 Thread Igor Tandetnik
Joanne Pham <[EMAIL PROTECTED]> wrote: > I have a question related toSQLite db handle(pDb in my codes). > I have the function below to open the database connection. I have to > call sqlite3_close(sqlite3 *)(sqlite3_close(pDb) in my case) > before open another database connection( by calling openDb)

[sqlite] sqlite3_close

2008-08-21 Thread Joanne Pham
Sorry! Resend an email because no subject in previous email. Again. Your help is greatly appreciated. Thanks, JP - Original Message From: Joanne Pham <[EMAIL PROTECTED]> To: General Discussion of SQLite Database Sent: Thursday, August 21, 2008 11:54:13 AM Subject: [sqlite] (no subject)

Re: [sqlite] sqlite3_close doesn't release always the file handle.

2006-09-23 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > Joe Wilson <[EMAIL PROTECTED]> wrote: > > --- [EMAIL PROTECTED] wrote: > > > Ran <[EMAIL PROTECTED]> wrote: > > > > Hi all, > > > > > > > > I *think* that sqlite3_close behave strangly. > > > > > > > > I use version 3.3.7 on Linux (Fedora Core 5). > > > > > > > > W

Re: [sqlite] sqlite3_close doesn't release always the file handle.

2006-09-23 Thread drh
Joe Wilson <[EMAIL PROTECTED]> wrote: > --- [EMAIL PROTECTED] wrote: > > Ran <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > > > I *think* that sqlite3_close behave strangly. > > > > > > I use version 3.3.7 on Linux (Fedora Core 5). > > > > > > What I do is to open a database, and start a trans

Re: [sqlite] sqlite3_close doesn't release always the file handle.

2006-09-23 Thread Joe Wilson
--- Joe Wilson <[EMAIL PROTECTED]> wrote: > --- [EMAIL PROTECTED] wrote: > > Ran <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > > > I *think* that sqlite3_close behave strangly. > > > > > > I use version 3.3.7 on Linux (Fedora Core 5). > > > > > > What I do is to open a database, and start a t

Re: [sqlite] sqlite3_close doesn't release always the file handle.

2006-09-23 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > Ran <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I *think* that sqlite3_close behave strangly. > > > > I use version 3.3.7 on Linux (Fedora Core 5). > > > > What I do is to open a database, and start a transaction in it. Then, > > without ending the transaction,

Re: [sqlite] sqlite3_close doesn't release always the file handle.

2006-09-23 Thread drh
Ran <[EMAIL PROTECTED]> wrote: > Hi all, > > I *think* that sqlite3_close behave strangly. > > I use version 3.3.7 on Linux (Fedora Core 5). > > What I do is to open a database, and start a transaction in it. Then, > without ending the transaction, open again the database and simply close it. >

Re: [sqlite] sqlite3_close doesn't release always the file handle.

2006-09-23 Thread Ran
I filed the bug report as you suggested: #1990. Ran. On 9/23/06, Will Leshner <[EMAIL PROTECTED]> wrote: On 9/22/06, Ran <[EMAIL PROTECTED]> wrote: > What I do is to open a database, and start a transaction in it. Then, > without ending the transaction, open again the database and simply clo

Re: [sqlite] sqlite3_close doesn't release always the file handle.

2006-09-22 Thread Will Leshner
On 9/22/06, Ran <[EMAIL PROTECTED]> wrote: What I do is to open a database, and start a transaction in it. Then, without ending the transaction, open again the database and simply close it. I found out, that the inner sqlite3_close return 0 (SQLITE_OK), but the file handle is not released. So i

[sqlite] sqlite3_close doesn't release always the file handle.

2006-09-22 Thread Ran
Hi all, I *think* that sqlite3_close behave strangly. I use version 3.3.7 on Linux (Fedora Core 5). What I do is to open a database, and start a transaction in it. Then, without ending the transaction, open again the database and simply close it. I found out, that the inner sqlite3_close retur

Re: [sqlite] sqlite3_close()

2005-11-09 Thread Joe Halpin
Ok, thanks. I'm pretty new to this kind of thing so I appreciate the feedback. joe John Stanton wrote: Try calling sqlite3_finalize on the prepared statements before sqlite3_close. Joe Halpin wrote: One of the return values from sqlite3_close() is SQLITE_BUSY. The examples I've seen so far

Re: [sqlite] sqlite3_close()

2005-11-09 Thread John Stanton
Try calling sqlite3_finalize on the prepared statements before sqlite3_close. Joe Halpin wrote: One of the return values from sqlite3_close() is SQLITE_BUSY. The examples I've seen so far all exit after calling this function and don't check the return value. I need to be able to close and reope

[sqlite] sqlite3_close()

2005-11-08 Thread Joe Halpin
One of the return values from sqlite3_close() is SQLITE_BUSY. The examples I've seen so far all exit after calling this function and don't check the return value. I need to be able to close and reopen the database without exiting, but I'm not sure what to do if I get SQLITE_BUSY as the return from