[sqlite] Understanding Shared-Cache Mode

2010-09-10 Thread Sam Carleton
I just read the page on Shared-Cache Mode and it left me with some questions... Q1: Is my understanding correct: Shared-Cache Mode is used within a process to gain table locking, as compared to the normal file locking. How to Enabling Shared-Cache Mode in the following situation: SQLite is

Re: [sqlite] Backing up SQLite file

2010-09-10 Thread Josh
Good point. Thanks. > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 09/10/2010 01:11 PM, Josh wrote: >> A saw the backup API's but they looked overly complicated for my situation. > > How so? > > There is sample code at this link (see the second example specifically): > >

[sqlite] tkt-9d68c88.test needs ifcapable vtab test

2010-09-10 Thread Noah Hart
This test uses sqlite3 db test.db -vfs devsym which is not available when compiled with SQLITE_OMIT_VIRTUALTABLE needs the following block ifcapable !vtab { finish_test return } Regards, Noah -- View this message in context:

[sqlite] journal2.test needs ifcapable !vtab block

2010-09-10 Thread Noah Hart
This test uses the testvfs which is not available when compiled with SQLITE_OMIT_VIRTUALTABLE ifcapable !vtab { finish_test return } Regards, Noah -- View this message in context: http://old.nabble.com/journal2.test-needs-ifcapable-%21vtab--block-tp29681580p29681580.html Sent from the

Re: [sqlite] Backing up SQLite file

2010-09-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/10/2010 01:11 PM, Josh wrote: > A saw the backup API's but they looked overly complicated for my situation. How so? There is sample code at this link (see the second example specifically): http://www.sqlite.org/backup.html It is at most 10

Re: [sqlite] Backing up SQLite file

2010-09-10 Thread Jay A. Kreibich
On Fri, Sep 10, 2010 at 01:11:23PM -0700, Josh scratched on the wall: > It should be noted that my program is a single thread, and I can assume no > other programs or threads should be accessing my database file. Since > SQLite auto commits transactions and I won't have any transactions open,

Re: [sqlite] Backing up SQLite file

2010-09-10 Thread Josh
Thanks so much, this helps. A saw the backup API's but they looked overly complicated for my situation. A little clarification. It should be noted that my program is a single thread, and I can assume no other programs or threads should be accessing my database file. Since SQLite auto commits

Re: [sqlite] Backing up SQLite file

2010-09-10 Thread Jay A. Kreibich
On Fri, Sep 10, 2010 at 12:09:58PM -0700, Josh scratched on the wall: > Hello all, > > I think this is a simple question... > > I am using the C api to open and read/write a SQLite database (ie. > sqlite3_open_v2() etc.). I would like to have a function in my program to > backup the database

[sqlite] Backing up SQLite file

2010-09-10 Thread Josh
Hello all, I think this is a simple question... I am using the C api to open and read/write a SQLite database (ie. sqlite3_open_v2() etc.). I would like to have a function in my program to backup the database file (using the OSes copy command). I can guarentee that my program will not write

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Max Vlasov
On Fri, Sep 10, 2010 at 6:32 PM, Shane Harrelson wrote: > I tried to reproduce this, and could not. > > There are some questions inline below.Additionally, I want to > verify that you've tried this with a version of SQLite containing the > previously linked fix. > > Shane,

Re: [sqlite] Detecting storage class from C

2010-09-10 Thread Simon Slavin
On 10 Sep 2010, at 6:01pm, Andrew Wood wrote: > One related question. The library Im using maps numeric types to one of > the following C types: > > unsigned long int > signed long int > unsigned int (short) > signed int (short) > float > double > > How does SQLite distinguish between

Re: [sqlite] Detecting storage class from C

2010-09-10 Thread Igor Tandetnik
Andrew Wood wrote: > One related question. The library Im using maps numeric types to one of > the following C types: > > unsigned long int > signed long int > unsigned int (short) > signed int (short) > float > double > > How does SQLite distinguish between ordinary floats

Re: [sqlite] Detecting storage class from C

2010-09-10 Thread Andrew Wood
On 09/09/10 00:01, Igor Tandetnik wrote: > No. sqlite3_column_type returns the type of the value in the given column and > the current row. The type reported by sqlite3_column_type may change from row > to row. It is largely unrelated to the type "you originally intended the > column to be"

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Shane Harrelson
I tried to reproduce this, and could not. There are some questions inline below.Additionally, I want to verify that you've tried this with a version of SQLite containing the previously linked fix. -Shane On Fri, Sep 10, 2010 at 12:54 AM, Max Vlasov wrote: >> But as a

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Michele Pradella
The question is about the possibility, but I should be sure that this do not happen in my application, because I have to make my application running for month without restart. So because in first few test I always see the -shm Mapped File grow up (even that less than before the patch) and I

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Max Vlasov
On Fri, Sep 10, 2010 at 5:07 PM, Michele Pradella < michele.prade...@selea.com> wrote: > > what I worry about is that the Addressed space of > sqlite (during an operation of DELETE or UPDATE a lot of data in WAL > mode use case described before) could grow up till 2GB. This cause the >

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Michele Pradella
Ok I understand that it's only address space and not allocated: anyway if the addressed, and so the reserved, memory grow up you will see the Virutal Bytes in the windows performance monitor grow up. This is ok in the normal function: what I worry about is that the Addressed space of sqlite

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Max Vlasov
On Fri, Sep 10, 2010 at 3:52 PM, Michele Pradella < michele.prade...@selea.com> wrote: > After some tests, with the new sqlite3.c source, seams that the > behavior is better than before. So I see the -shm and -wal file grow up, > and in VMMap I can see the Mapped File of -shm growing up, but not

Re: [sqlite] Feature request: copying vacuum

2010-09-10 Thread Jim Wilcoxson
I'd also be interested in a VACUUM TO feature, more for performance aspect than the fragmentation, although that's a plus too. The backup program I'm working on packs many files into archives, which are SQLite databases. I have run some vacuum tests here; the filesystem cache was purged before

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Michele Pradella
After some tests, with the new sqlite3.c source, seams that the behavior is better than before. So I see the -shm and -wal file grow up, and in VMMap I can see the Mapped File of -shm growing up, but not so much as before. With VMMap I can see only -shm mapped files of 32K or 64K and I'm able

[sqlite] How to inject primary keys which are set to autoincrement in sqlite??

2010-09-10 Thread Anthony Main
In MS SQL I would use SET IDENTITY INSERT ON How do I do something similar in SQLite. I am trying to upgrade a database and want to maintain the IDs from the original Thanks ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] How to inject primary keys which are set to autoincrement in sqlite??

2010-09-10 Thread Anthony Main
In MS SQL I would use SET IDENTITY INSERT ON How do I do something similar in SQLite. I am trying to upgrade a database and want to maintain the IDs from the original Thanks ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Michele Pradella
ok, Dan already sent me a sqlite3.c source, and I'm doing some tests...I let you know the results Il 10/09/2010 12.12, Max Vlasov ha scritto: > On Fri, Sep 10, 2010 at 12:53 PM, Dan Kennedy wrote: > >> The bug is fixed by Shane's patch linked earlier in the thread. With

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Max Vlasov
On Fri, Sep 10, 2010 at 12:53 PM, Dan Kennedy wrote: > > The bug is fixed by Shane's patch linked earlier in the thread. With > the patch, an 11MB -shm file is mapped into memory in around 350 chunks > with an average size of 48KB. Total address space used is around >

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Michele Pradella
I tried yesterday to apply the patch to my sqlite3.c and I think that the problem's not fixed: but perhaps I'm wrong or I miss something applying the patch. Can you provide me a sqlite3.c source with this patch applied correctly so I can test if this issue is correct? Il 10/09/2010 10.53,

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Dan Kennedy
> Michele, thanks for pointing out to vmmap, sysinternals made them so > fast, I > can not track them all. This is an excellent utility. > I think that the development team already knows that is going on, > just my > speculation. > > As long as I see, every next file mapping wants to see not

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Max Vlasov
On Fri, Sep 10, 2010 at 11:29 AM, Michele Pradella < michele.prade...@selea.com> wrote: > I forgot to tell you something: in my situation the -shm file is > always small in size (about 6-7MB) even when I got 2GB of Virtual Bytes. > But it seams that is mapped too much times. > I see something

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Michele Pradella
I forgot to tell you something: in my situation the -shm file is always small in size (about 6-7MB) even when I got 2GB of Virtual Bytes. But it seams that is mapped too much times. I see something that you could obtain if you do this: for (int i=0;i<1000;i++) "Map -shm in memory" This is

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Michele Pradella
Even in my use case I got "Disk I/O error" after I reached 2GB of virtual memory. Max tell us the size of the memory mapped file in VMMap tool when you got "Disk I/O error", and check the value of Virtual Bytes in windows performance counter Il 10/09/2010 6.54, Max Vlasov ha scritto: >> But

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Michele Pradella
Hi Shane, have you look at the Virtual Bytes in the performance monitor? in my situation is that counter that grow up to 2GB and than application crash because virtual space finish. I'm using Windows XP professional SP3. I can reproduce the problem in my DB with this SQL statement: DELETE

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-10 Thread Michele Pradella
Hi Max, I'm sure that is a leak related to sqlite WAL because if I disable WAL with journal_mode=DELETE and I do not have the leak. More over if I use vmmap tool I see the size of the mapped files growing up and vmmap show me that all the memory is used by -shm files mapped a lot of times.