[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] library routine called out of sequence
From:       "Michael Stephenson" <domehead100 () gmail ! com>
Date:       2011-12-24 3:23:44
Message-ID: 032801ccc1eb$71dfcef0$559f6cd0$ () gmail ! com
[Download RAW message or body]

Assuming that you are calling reset after each use of a prepared statement
and/or that the error occurs on the very first bind...

This sounds like in the working case the statements are prepared, bound, and
then reset by the same thread each time these steps are done, but perhaps in
the non-working case the statements are prepared in one thread and then
bound in different threads (perhaps even on the first call to bind).  I
think that might be your issue.

Which version of SQLite are you using, and what OS?  Is thread support
compiled in to your SQLite instance?

Also, could two threads be attempting to bind the same statement at the same
time?

-----Original Message-----
From: sqlite-users-bounces@sqlite.org
[mailto:sqlite-users-bounces@sqlite.org] On Behalf Of Sreekumar TP
Sent: Friday, December 23, 2011 9:06 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] library routine called out of sequence

Hi,

yes, I know. I have a multithreaded app. One db conection.I will try to
reproduce the problem with a simple app.

However, the difference between the working and non working case is that in
the working case statements are prepared each time. In the non working case,
its reused.

The very first call to bind throws this error.

Sreekumar
On Dec 23, 2011 2:51 PM, "Pavel Ivanov" <paivanof@gmail.com> wrote:
>
> Devil is in the details. What you described in general is okay. But I 
> guess the exact code you have has some problems. To find them we 
> should see the code.
>
> An just some first check: do you have a single-threaded application 
> accessing database?
>
>
> Pavel
>
>
> On Fri, Dec 23, 2011 at 3:32 AM, Sreekumar TP <sreekumar.tp@gmail.com>
wrote:
> > Hi ,
> >
> > I have a strange problem. I do the following in sequence -
> >
> > 1. open database
> > 2. set pragmas
> > 3.create table
> > 4. prepare a paremetrised statement ( SELECT ..) 5. bind values to 
> > the statement 6. step
> >
> > At 5, I get the error  "library routine called out of sequence".
> >
> > If I replace the parameterised statement  with a 'non-parameterised'
> > statement, I have no issues.
> >
> > If I use a parameterized INSERT statement , I do not get the error.
> >
> > Any suggestions?
> >
> > -Sreekumar
> > _______________________________________________
> > 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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic