Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Pavel Ivanov
> Is it possible to check even if a db file exists and if necessary create it > from within c++ ? > So I would open the db file  sqlite3_open("ah.db", &db);   only if it really > exists .. Why do you need to create file from C++? If file doesn't exist SQLite will automatically create it for you af

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Simon Slavin
On 26 Jun 2012, at 5:27pm, deltagam...@gmx.net wrote: > Is it possible to check even if a db file exists and if necessary create it > from within c++ ? > So I would open the db file sqlite3_open("ah.db", &db); only if it really > exists .. Look at the flags available to the _open_v2() funct

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread deltagam...@gmx.net
Am 26.06.2012 18:00, schrieb Pavel Ivanov: On Tue, Jun 26, 2012 at 11:50 AM, deltagam...@gmx.net wrote: Am 26.06.2012 17:08, schrieb Pavel Ivanov: You are leaking stmt statement (re-preparing without finaliznig) and your call to sqlite3_close returns SQLITE_ERROR because of that, but you don'

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Pavel Ivanov
On Tue, Jun 26, 2012 at 11:50 AM, deltagam...@gmx.net wrote: > Am 26.06.2012 17:08, schrieb Pavel Ivanov: > >> You are leaking stmt statement (re-preparing without finaliznig) and >> your call to sqlite3_close returns SQLITE_ERROR because of that, but >> you don't even check that so you are leakin

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Richard Hipp
On Tue, Jun 26, 2012 at 11:50 AM, deltagam...@gmx.net wrote: > Am 26.06.2012 17:08, schrieb Pavel Ivanov: // select count(*) from > eventlog > sqltotal = "Select count(*) from eventlog"; >rc = sqlite3_prepare(db, sqltotal, strlen(sqltotal), &stmt, NULL); >rc = sqlite3_step(stmt); >

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread deltagam...@gmx.net
Am 26.06.2012 17:08, schrieb Pavel Ivanov: You are leaking stmt statement (re-preparing without finaliznig) and your call to sqlite3_close returns SQLITE_ERROR because of that, but you don't even check that so you are leaking database connections as well. Pavel On Tue, Jun 26, 2012 at 11:01 AM

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Richard Hipp
On Tue, Jun 26, 2012 at 11:15 AM, Simon Slavin wrote: > > On 26 Jun 2012, at 4:11pm, "Black, Michael (IS)" > wrote: > > > So...transaction is started at sqlite3_step and stays open until > sqlite3_reset or sqlite3_finalize, right? > > > > sqlite3_close would do what if you didn't finalize? Just

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Richard Hipp
ion Systems > > > > ________ > > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] > > on behalf of Richard Hipp [d...@sqlite.org] > > Sent: Tuesday, June 26, 2012 9:49 AM > > To: General Discussion of SQLite Databas

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Richard Hipp
On Tue, Jun 26, 2012 at 11:08 AM, Pavel Ivanov wrote: > You are leaking stmt statement (re-preparing without finaliznig) and > your call to sqlite3_close returns SQLITE_ERROR because of that, but > you don't even check that so you are leaking database connections as > well. > Good eye, Pavel! N

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Simon Slavin
On 26 Jun 2012, at 4:11pm, "Black, Michael (IS)" wrote: > So...transaction is started at sqlite3_step and stays open until > sqlite3_reset or sqlite3_finalize, right? > > sqlite3_close would do what if you didn't finalize? Just a memory leak or > worse? Or would sqlite3_close return an erro

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Black, Michael (IS)
26, 2012 9:54 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] access from 2 different programms to same sqlite3-db On Tue, Jun 26, 2012 at 10:51 AM, Black, Michael (IS) < michael.bla...@ngc.com> wrote: > Does that mean the "prepare" is wrapped inside a tra

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Pavel Ivanov
You are leaking stmt statement (re-preparing without finaliznig) and your call to sqlite3_close returns SQLITE_ERROR because of that, but you don't even check that so you are leaking database connections as well. Pavel On Tue, Jun 26, 2012 at 11:01 AM, deltagam...@gmx.net wrote: > Am 26.06.2012

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Richard Hipp
On Tue, Jun 26, 2012 at 11:01 AM, deltagam...@gmx.net wrote: > Am 26.06.2012 16:49, schrieb Richard Hipp: > > On Tue, Jun 26, 2012 at 10:46 AM, deltagam...@gmx.net >> wrote: >> >> I have a c++ GUI application from where the db is read and the content is >>> displayed in a Clistbox. >>> Then I tr

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread deltagam...@gmx.net
Am 26.06.2012 16:49, schrieb Richard Hipp: On Tue, Jun 26, 2012 at 10:46 AM, deltagam...@gmx.net wrote: I have a c++ GUI application from where the db is read and the content is displayed in a Clistbox. Then I try to delete some rows from the sqlite3-db from the console. After rereading from wi

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Richard Hipp
nformation Systems > > > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] > on behalf of Richard Hipp [d...@sqlite.org] > Sent: Tuesday, June 26, 2012 9:49 AM > To: General Discussion of SQLite Database > Subject: EXT :Re: [sq

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Black, Michael (IS)
om: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Richard Hipp [d...@sqlite.org] Sent: Tuesday, June 26, 2012 9:49 AM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] access from 2 different programms to same sqlite3-db On Tue, Jun 26, 2012 a

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Richard Hipp
On Tue, Jun 26, 2012 at 10:46 AM, deltagam...@gmx.net wrote: > I have a c++ GUI application from where the db is read and the content is > displayed in a Clistbox. > Then I try to delete some rows from the sqlite3-db from the console. > After rereading from within the GUI the deleted rows are stil