Re: [sqlite] System.Data.SQLite execute query without using of indexes

2011-09-07 Thread Joe Mistachkin

Your C# code is timing the entire loop while appending to a StringBuilder.
This is going to be slower than simply running the SQLite query.  I suggest
trying the following change to get a clearer picture of the time spent
executing the actual query:

cmd.Prepare();
var dtStart = Environment.TickCount;
DbDataReader reader =
cmd.ExecuteReader(CommandBehavior.CloseConnection);
var dtEnd = Environment.TickCount;

try
{
  while (reader.Read())
  {
sb.AppendFormat("PersonId: {0}\r\n", reader[0]);
  }
}
finally
{
  reader.Close();
}

Please note that even the above code will show some overhead associated with
using SQLite from managed code; however, it will be less than the original
code.

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Cache Usage

2011-09-07 Thread Mohit Sindhwani

Hi Pavel,

On 7/9/2011 10:16 PM, Pavel Ivanov wrote:

1. If we have a 1MB cache (1000 pages x 1KB/page), is it allocated
immediately and used or is it allocated as queries come in?

Cache is not allocated immediately. It's allocated when SQLite needs
to read something from disk (or write a newly created page). SQLite
reads it and caches.


2. Does the cache keep filling up till it's full, i.e., each new query that
accesses a different page causes the cache to fill up with those pages - or
does it reuse pages when new queries happen even if the cache is not full?

It fills up until it's full.


3. Does the cache store only results or does it store the table data?

Cache stores raw database pages (which can be table data or indexes).
So, I'd say the general rule should be the bigger the database the
bigger the cache should be for a comfortable work.


Thank you for your answers - this gives me enough ideas on managing 
memory in our systems better!


Thanks,
Mohit.
8/9/2011 | 1:28 AM.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3.h file?

2011-09-07 Thread Stephan Beal
On Tue, Sep 6, 2011 at 5:33 PM, Eduard Filipas wrote:

> i searched your website and i cant find sqlite3.h file. where can i get
> proper one?
>


http://www.sqlite.org/download.html

it's part of the download bundles. Try the top link on that page.


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite giving error with nested inner joins

2011-09-07 Thread Ben van der Merwe

Hi,
We make use of a number of queries which we also run against other databases. 
Consider this simplified example:
SELECT psim_objects.ObjectName, property.AttributeTextValue, data.Attribute, 
data.AttributeUOM FROM psim_objects  INNER JOIN (psim_objectdata data  INNER 
JOIN psim_objectdata property ON data.ObjectID = property.ObjectID)  ON 
psim_objects.ObjectID = data.OwnerObject 
It executes fine on other databases, but on SQLite it gives the error:
SQL Error: Error running Query - no such column: property.AttributeTextValue
Now, one can rewrite this query so it does work, but it should work as is on 
SQLite, it works as is on other databases, and a number of tools that build 
queries tend to build queries like this.
Please evaluate this and log it as a bug or enhancement request as appropriate?
Also, I am sure this must be logged somewhere, yet I can not see it in the bug 
and enhancement list, but it would be very convenient if SQLite would support 
more of the now standard SQL string functions like LEFT, RIGHT, SUBSTRING, etc. 
I know SQLite has SUBSTR and you can extend the functions and SQLite does not 
compete with Oracle, SQL Server etc. but there is some benefit in being able to 
write one SQL query that runs on a number of databases rather than "if Oracle 
do this... If sqlite do this...". I think SQLite is possibly the only database 
which does not have the LEFT string function. Please log that as an enhancement 
request.
Thank you kindly for your consideration.
  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3.h file?

2011-09-07 Thread Eduard Filipas

Hi

i searched your website and i cant find sqlite3.h file. where can i get 
proper one?


regards
Eduard Filipas
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] System.Data.SQLite execute query without using of indexes

2011-09-07 Thread Evgeny Gavrilenko
Hi,
I have a table with 10 000 000 records
there is compound primary key (ObjectID, AttributeID)

1.  when I exequte next query
SELECT * FROM ObjectValue WHERE ObjectID=4 AND AttributeID=3;
in managment tool e.g.sqliteadmin the time of execution is ~16ms
(return result : 1 row)

2. execute this query using System.Data.SQLite:
using (var _cnn = new SQLiteConnection(connectionString))
{
_cnn.Open();
using (DbCommand cmd = _cnn.CreateCommand())
{
cmd.CommandText = @"SELECT * FROM ObjectValue WHERE
ObjectID=@objectId AND AttributeID=@attributeID;";
cmd.CommandType = CommandType.Text;
cmd.Parameters.Add(new SQLiteParameter("@objectId",
4));
cmd.Parameters.Add(new SQLiteParameter("@attributeID",
3));
cmd.Prepare();
var dtStart = Environment.TickCount;
using (DbDataReader reader =
cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
while (reader.Read())
{
sb.AppendFormat("PersonId: {0}\r\n", reader[0]);
}
}
var dtEnd = Environment.TickCount;
.
time of execution is ~17000ms


WHY?
My proposition is the index isn't use...

--
Regards,
Evgeny Gavrilenko
email: egavrile...@gmail.com
+375 25 777 19 19
+375 29 218 73 27
skype: evgeny_gavrilenko
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Double Spaced Blob Text

2011-09-07 Thread Filip Navara
I guess the database is encoded in UTF-16 and you are reading the text
using sqlite3_column_blob instead of sqlite3_column_text.

F.

On Wed, Sep 7, 2011 at 5:15 PM, Daniel Spain  wrote:
>
>
>
>
> hello all i am creating a text mud gamibng engine and has been going great up 
> until recently.when a user is examining their current room all the text is 
> double spaced.i have tried this as both a blob and text field with a max 
> length of 4096. here is my funtion to display long room descriptions: GBOOL 
> EXPORTlook(VOID)/* examine current room */{       if(islit(chrptr->loc))      
>   {            prfmlt(LOKOTH,chrptr->name);             
> outloc(getloc(usrnum),usrnum,-1);            
> prfmlt(LOOKING,database_blob("Rooms",chrptr->loc,ROOMKEY_LONGDESC));          
>   outmlt(usrnum);       }       else       {           prfmlt(TOODRK);        
>    outmlt(usrnum);       }       return(TRUE);} here is the database_blob 
> function: CHAR * EXPORTdatabase_blob(const CHAR *table,const LONG 
> record,const LONG field)/* return blob field value from a table */{     const 
> CHAR *tail;     static CHAR ret[4096];      strcpy(ret,"NULL");      
> sprintf(vdatmp,"SELECT * FROM %s WHERE Record = %ld",table,record)
>  ;     
> if(sqlite3_prepare_v2(database,vdatmp,strlen(vdatmp),,)==SQLITE_OK)
>      {         while(sqlite3_step(statement) == SQLITE_ROW)         {         
>       strncpy(ret,sqlite3_column_blob(statement,field),4096);         }     } 
>      return(ret);}  it all works fine it just double spaces the returned 
> text.some of my beta testers stripped all the periods from the text and 
> saidit worked fine so i don't know if the periods are somehow sayingmove to 
> the next line or what. thanks.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Double Spaced Blob Text

2011-09-07 Thread Black, Michael (IS)
I sincerely doubt that sqlite is your problem as everybody else would be seeing 
the same problem.



What is the prfmlt() function?  I would suspect whatever is interpreting your 
output stream is the culprit.



I've seen historically where a period can mean end-of-line.





Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate




From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Daniel Spain [dspai...@msn.com]
Sent: Wednesday, September 07, 2011 10:15 AM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] Double Spaced Blob Text





hello all i am creating a text mud gamibng engine and has been going great up 
until recently.when a user is examining their current room all the text is 
double spaced.i have tried this as both a blob and text field with a max length 
of 4096. here is my funtion to display long room descriptions: GBOOL 
EXPORTlook(VOID)/* examine current room */{   if(islit(chrptr->loc))
{prfmlt(LOKOTH,chrptr->name); 
outloc(getloc(usrnum),usrnum,-1);
prfmlt(LOOKING,database_blob("Rooms",chrptr->loc,ROOMKEY_LONGDESC));
outmlt(usrnum);   }   else   {   prfmlt(TOODRK);   
outmlt(usrnum);   }   return(TRUE);} here is the database_blob 
function: CHAR * EXPORTdatabase_blob(const CHAR *table,const LONG record,const 
LONG field)/* return blob field value from a table */{ const CHAR *tail;
 static CHAR ret[4096];  strcpy(ret,"NULL");  sprintf(vdatmp,"SELECT * 
FROM %s WHERE Record = %ld",table,record)
 ; 
if(sqlite3_prepare_v2(database,vdatmp,strlen(vdatmp),,)==SQLITE_OK)
 { while(sqlite3_step(statement) == SQLITE_ROW) {   
strncpy(ret,sqlite3_column_blob(statement,field),4096); } } 
 return(ret);}  it all works fine it just double spaces the returned text.some 
of my beta testers stripped all the periods from the text and saidit worked 
fine so i don't know if the periods are somehow sayingmove to the next line or 
what. thanks.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Double Spaced Blob Text

2011-09-07 Thread Daniel Spain




hello all i am creating a text mud gamibng engine and has been going great up 
until recently.when a user is examining their current room all the text is 
double spaced.i have tried this as both a blob and text field with a max length 
of 4096. here is my funtion to display long room descriptions: GBOOL 
EXPORTlook(VOID)/* examine current room */{   if(islit(chrptr->loc))
{prfmlt(LOKOTH,chrptr->name); 
outloc(getloc(usrnum),usrnum,-1);
prfmlt(LOOKING,database_blob("Rooms",chrptr->loc,ROOMKEY_LONGDESC));
outmlt(usrnum);   }   else   {   prfmlt(TOODRK);   
outmlt(usrnum);   }   return(TRUE);} here is the database_blob 
function: CHAR * EXPORTdatabase_blob(const CHAR *table,const LONG record,const 
LONG field)/* return blob field value from a table */{ const CHAR *tail;
 static CHAR ret[4096];  strcpy(ret,"NULL");  sprintf(vdatmp,"SELECT * 
FROM %s WHERE Record = %ld",table,record)
 ; 
if(sqlite3_prepare_v2(database,vdatmp,strlen(vdatmp),,)==SQLITE_OK)
 { while(sqlite3_step(statement) == SQLITE_ROW) {   
strncpy(ret,sqlite3_column_blob(statement,field),4096); } } 
 return(ret);}  it all works fine it just double spaces the returned text.some 
of my beta testers stripped all the periods from the text and saidit worked 
fine so i don't know if the periods are somehow sayingmove to the next line or 
what. thanks.  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite Cache Usage

2011-09-07 Thread Pavel Ivanov
> 1. If we have a 1MB cache (1000 pages x 1KB/page), is it allocated
> immediately and used or is it allocated as queries come in?

Cache is not allocated immediately. It's allocated when SQLite needs
to read something from disk (or write a newly created page). SQLite
reads it and caches.

> 2. Does the cache keep filling up till it's full, i.e., each new query that
> accesses a different page causes the cache to fill up with those pages - or
> does it reuse pages when new queries happen even if the cache is not full?

It fills up until it's full.

> 3. Does the cache store only results or does it store the table data?

Cache stores raw database pages (which can be table data or indexes).
So, I'd say the general rule should be the bigger the database the
bigger the cache should be for a comfortable work.


Pavel


On Wed, Sep 7, 2011 at 8:01 AM, Mohit Sindhwani  wrote:
> Hi All,
>
> We are right now reviewing our usage of SQLite3 and are seeing how we can
> optimize its usage of disk space, run-time memory and its performance for
> our applications.  So far, we are discovering a lot of new things - and it's
> very interesting to see things we may have overlooked at first glance.  Most
> of our usage of SQLite3 is in read-only databases and we're already using
> CEROD.
>
> We are now starting to see how the performance of our queries is affected by
> the usage of the cache.  We have the cache designated as 1000 pages with a
> page size of 1Kbyte.  Increasing the page size helps and increasing the
> cache size also helps.
>
> However, I am trying to understand how the cache is used.  These are some of
> the questions I have:
> 1. If we have a 1MB cache (1000 pages x 1KB/page), is it allocated
> immediately and used or is it allocated as queries come in?
> 2. Does the cache keep filling up till it's full, i.e., each new query that
> accesses a different page causes the cache to fill up with those pages - or
> does it reuse pages when new queries happen even if the cache is not full?
> 3. Does the cache store only results or does it store the table data?
>
> One of the reasons to ask is that currently, we use a few different
> databases and each has the same cache setting.  We are wondering if we
> should tune the cache settings in each of the databases.
>
> Thanks for any help.
>
> Best Regards,
> Mohit.
> 7/9/2011 | 8:01 PM.
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite+ICU library and usage of LIKE

2011-09-07 Thread Igor Tandetnik
sreekumar...@gmail.com wrote:
> The _ operator( match any single char in the string) does not seem to work.. 
> % is ok..

Show your data and your statement. Explain what outcome you observe, and how it 
differs from your expectations.
-- 
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite+ICU library and usage of LIKE

2011-09-07 Thread sreekumar . tp

The _ operator( match any single char in the string) does not seem to work.. % 
is ok..

Any clue? 

Sent from BlackBerry® on Airtel

-Original Message-
From: "Michael Stephenson" 
Sender: sqlite-users-boun...@sqlite.org
Date: Tue, 6 Sep 2011 12:55:02 
To: 'General Discussion of SQLite Database'
Reply-To: General Discussion of SQLite Database 
Subject: Re: [sqlite] Sqlite+ICU library and usage of LIKE

"It's rather pointless to use a LIKE operator with no wildcards."

Except that it performs a case-insensitive comparison, so  a quick-and-dirty 
way to accomplish that.

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Igor Tandetnik
Sent: Tuesday, September 06, 2011 11:52 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Sqlite+ICU library and usage of LIKE

On 9/6/2011 11:41 AM, Sreekumar TP wrote:
> If I modify the statement to return all strings which match 'м' , No 
> strings are fetched.
>
>   zSQL = sqlite3_snprintf(1024,temp2,"SELECT * FROM l1 WHERE data  LIKE 'м'
> ;");

You probably want LIKE 'м%'. It's rather pointless to use a LIKE operator with 
no wildcards.
--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite Cache Usage

2011-09-07 Thread Mohit Sindhwani

Hi All,

We are right now reviewing our usage of SQLite3 and are seeing how we 
can optimize its usage of disk space, run-time memory and its 
performance for our applications.  So far, we are discovering a lot of 
new things - and it's very interesting to see things we may have 
overlooked at first glance.  Most of our usage of SQLite3 is in 
read-only databases and we're already using CEROD.


We are now starting to see how the performance of our queries is 
affected by the usage of the cache.  We have the cache designated as 
1000 pages with a page size of 1Kbyte.  Increasing the page size helps 
and increasing the cache size also helps.


However, I am trying to understand how the cache is used.  These are 
some of the questions I have:
1. If we have a 1MB cache (1000 pages x 1KB/page), is it allocated 
immediately and used or is it allocated as queries come in?
2. Does the cache keep filling up till it's full, i.e., each new query 
that accesses a different page causes the cache to fill up with those 
pages - or does it reuse pages when new queries happen even if the cache 
is not full?

3. Does the cache store only results or does it store the table data?

One of the reasons to ask is that currently, we use a few different 
databases and each has the same cache setting.  We are wondering if we 
should tune the cache settings in each of the databases.


Thanks for any help.

Best Regards,
Mohit.
7/9/2011 | 8:01 PM.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Order not case sensitive

2011-09-07 Thread Sintoni Stefano (GMAIL)
Perfect, more more thanks.

*Sintoni Stefano*

On 09/07/2011 11:37 AM, Simon Slavin wrote:
> On 7 Sep 2011, at 9:39am, Sintoni Stefano (GMAIL) wrote:
>
>> I need to perform one statement like the follow
>>
>> SELECT itemnames FROM table WHERE condition ORDER BY item ASC;
>>
>> But the ORDER BY need to be not case-sensitive.
> sqlite> create table test (value text);
> sqlite> insert into test values ('A');
> sqlite> insert into test values ('b');
> sqlite> insert into test values ('C');
> sqlite> select * from test order by value;
> A
> C
> b
> sqlite> select * from test order by value collate nocase;
> A
> b
> C
>
> However, if case-sensitivity of 'item' never matters at all (and usually it 
> always matters or never matters) it is far better to build this information 
> into the design of your schema.  You would do this as follows:
>
> sqlite> create table testnocase (value text collate nocase);
> sqlite> insert into testnocase values ('A');
> sqlite> insert into testnocase values ('b');
> sqlite> insert into testnocase values ('C');
> sqlite> select * from testnocase order by value;
> A
> b
> C
>
> Also, hey presto:
>
> sqlite> select * from test where value='B';
> sqlite> select * from testnocase where value='B';
> b
>
> This means that all sorting and matching by that column will be done using 
> 'NOCASE', so you don't have to remember to keep mentioning NOCASE or using 
> LIKE in every sort and match you do.  It's faster too, since if you make an 
> index on that column, the index will be made in the basis of NOCASE too.  
> When defining a new table schema it's often worth considering NOCASE for any 
> TEXT column you might want to search or match on.  Building this into the 
> schema makes a good explanation to anyone who has to work with your database.
>
> Note that NOCASE does not correctly deal with the full range of Unicode 
> characters, just the Roman alphabet.  Also, there's no 'COLLATE CASE' (if you 
> ever need to reverse it) you do 'COLLATE BINARY' instead.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Order not case sensitive

2011-09-07 Thread Simon Slavin

On 7 Sep 2011, at 9:39am, Sintoni Stefano (GMAIL) wrote:

> I need to perform one statement like the follow
> 
> SELECT itemnames FROM table WHERE condition ORDER BY item ASC;
> 
> But the ORDER BY need to be not case-sensitive.

sqlite> create table test (value text);
sqlite> insert into test values ('A');
sqlite> insert into test values ('b');
sqlite> insert into test values ('C');
sqlite> select * from test order by value;
A
C
b
sqlite> select * from test order by value collate nocase;
A
b
C

However, if case-sensitivity of 'item' never matters at all (and usually it 
always matters or never matters) it is far better to build this information 
into the design of your schema.  You would do this as follows:

sqlite> create table testnocase (value text collate nocase);
sqlite> insert into testnocase values ('A');
sqlite> insert into testnocase values ('b');
sqlite> insert into testnocase values ('C');
sqlite> select * from testnocase order by value;
A
b
C

Also, hey presto:

sqlite> select * from test where value='B';
sqlite> select * from testnocase where value='B';
b

This means that all sorting and matching by that column will be done using 
'NOCASE', so you don't have to remember to keep mentioning NOCASE or using LIKE 
in every sort and match you do.  It's faster too, since if you make an index on 
that column, the index will be made in the basis of NOCASE too.  When defining 
a new table schema it's often worth considering NOCASE for any TEXT column you 
might want to search or match on.  Building this into the schema makes a good 
explanation to anyone who has to work with your database.

Note that NOCASE does not correctly deal with the full range of Unicode 
characters, just the Roman alphabet.  Also, there's no 'COLLATE CASE' (if you 
ever need to reverse it) you do 'COLLATE BINARY' instead.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Order not case sensitive

2011-09-07 Thread Sintoni Stefano (GMAIL)
Hi,
I need to perform one statement like the follow

SELECT itemnames FROM table WHERE condition ORDER BY item ASC;

But the ORDER BY need to be not case-sensitive.

It's possible ?

Thanks in advance.

Stefano


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SIGBUS errors with WAL mode and multiple simultaneous updating clients

2011-09-07 Thread Brodie Thiesfield
Hi,

I seeing some SIGBUS faults during startup in the debug version of my
app, but only when running under valgrind, and only for some clients.
The faults appear to be occurring around the same location in the
sqlite WAL code. If I disable WAL then there are no faults. If I don't
run it under valgrind then there are no problems (so don't run it
under valgrind?). I don't know if this problem is caused by my code or
perhaps an issue in the sqlite WAL code caused by timing (since the
startup is much slower under valgrind).

The error occurs with a newly created database file containing a
number of tables and data. It is small -> about 80kb. I've upgraded
everything to latest versions and the problem persists, currently
using valgrind 3.6.1 and sqlite 3.7.7.1 (amalgamation). CentOS 5.6.
app built with gcc 4.4.4. I'm not using any sqlite compile time flags.

The app is a parent process that does a fork/exec of 5 children (same
results with different numbers of children). Each child runs some
simple test code mostly simultaneously. I find that usually 1 child
faults, sometimes more or less. The busy handler is usually called a
number of times for the clients, sometimes delaying for up to a few
seconds before retrying.

The parent may have multiple database connections open at the time of
the fork. They are closed in the child process before the exec. I
can't close them before that as they are in active use in the parent.
I've checked that there are no open file descriptors (other than those
that valgrind has) at the time of process startup.

If there is something that anyone can suggest to narrow down the
problem then I would be interested to hear it.

Regards,
Brodie


Some example stack traces:

==23787== Process terminating with default action of signal 7
(SIGBUS): dumping core
==23787==  Non-existent physical address at address 0x5D94068
==23787==    at 0x8484CAF: walIndexRecover (sqlite3.c:44817)
==23787==    by 0x8485DE2: walIndexReadHdr (sqlite3.c:45569)
==23787==    by 0x8485EC0: walTryBeginRead (sqlite3.c:45682)
==23787==    by 0x8486231: sqlite3WalBeginReadTransaction (sqlite3.c:45839)
==23787==    by 0x84802A6: pagerBeginReadTransaction (sqlite3.c:39822)
==23787==    by 0x84820A5: sqlite3PagerSharedLock (sqlite3.c:41678)
==23787==    by 0x848A0EC: lockBtree (sqlite3.c:49813)
==23787==    by 0x848A7AA: sqlite3BtreeBeginTrans (sqlite3.c:50105)
==23787==    by 0x84C637C: sqlite3InitOne (sqlite3.c:89829)
==23787==    by 0x84C678D: sqlite3Init (sqlite3.c:89998)
==23787==    by 0x84C6876: sqlite3ReadSchema (sqlite3.c:90035)
==23787==    by 0x84C3298: sqlite3Pragma (sqlite3.c:88616)
==23787==    by 0x84DF79A: yy_reduce (sqlite3.c:106258)
==23787==    by 0x84E00FF: sqlite3Parser (sqlite3.c:106641)
==23787==    by 0x84E0D13: sqlite3RunParser (sqlite3.c:107465)
==23787==    by 0x84C6BD5: sqlite3Prepare (sqlite3.c:90212)
==23787==    by 0x84C6ED4: sqlite3LockAndPrepare (sqlite3.c:90304)
==23787==    by 0x84C7043: sqlite3_prepare (sqlite3.c:90367)
==23787==    by 0x84C1A35: sqlite3_exec (sqlite3.c:86911)
==23787==    by 0x840F554:
cl::DatabaseSqlite::Connect(cl::StringBuffer
const&, int) (DatabaseSqlite.cpp:113)
==23787==    by 0x83F1BCC: cl::Database::InitDatabaseSqlite(void*)
(Database.cpp:631)
==23787==    by 0x83F07DA:
cl::Database::Init(boost::shared_ptr&)
(Database.cpp:465)
==23787==    by 0x83F03E7:
cl::Database::Connect(boost::shared_ptr&,
boost::shared_ptr&) (Database.cpp:382)
==23787==    by 0x82CDE08: clsoapmain(int, char**) (clsoapMain.cpp:306)
==23787==    by 0x82DA099: main (clsoapUnix.cpp:32)



==23771== Process terminating with default action of signal 7
(SIGBUS): dumping core
==23771==  Non-existent physical address at address 0x5D9B686
==23771==    at 0x84863B0: sqlite3WalRead (sqlite3.c:45931)
==23771==    by 0x847FF1D: readDbPage (sqlite3.c:39604)
==23771==    by 0x84822AF: sqlite3PagerAcquire (sqlite3.c:41841)
==23771==    by 0x848929B: btreeGetPage (sqlite3.c:49066)
==23771==    by 0x848938E: getAndInitPage (sqlite3.c:49119)
==23771==    by 0x848C586: moveToChild (sqlite3.c:51633)
==23771==    by 0x848C8EA: moveToLeftmost (sqlite3.c:51798)
==23771==    by 0x848D2E3: sqlite3BtreeNext (sqlite3.c:52180)
==23771==    by 0x848D2A7: sqlite3BtreeNext (sqlite3.c:52170)
==23771==    by 0x84A2469: sqlite3VdbeExec (sqlite3.c:67148)
==23771==    by 0x849ABBF: sqlite3Step (sqlite3.c:61204)
==23771==    by 0x849ADAB: sqlite3_step (sqlite3.c:61277)
==23771==    by 0x8410AEB: cl::RequestSqlite::Step() (DatabaseSqlite.cpp:566)
==23771==    by 0x83F5777: cl::Database::LoadStrings(char,
std::vector&) (Database.cpp:1623)
==23771==    by 0x83F0C91: cl::Database::TestDatabaseStrings()
(Database.cpp:532)
==23771==    by 0x83F0A96:
cl::Database::Init(boost::shared_ptr&)
(Database.cpp:508)
==23771==    by 0x83F03E7:
cl::Database::Connect(boost::shared_ptr&,
boost::shared_ptr&) (Database.cpp:382)
==23771==    by 0x82CDE08: clsoapmain(int, char**)