Thanks for the clarification.
The error I am receiving must then be produced by the application rather
than just reporting an SQLite error.
Or
The application is taking control of the commit wait time, allowing my
script to continue.
Or more correct perhaps; the script commands are passed to the application
which allows the script to continue producing the DETACH error.

*****
There was a problem querying the database:
Error executing SQL statement "DETACH ExportDB
" : SQL logic error or missing database (1,1)
Cancel, Retry, Ignore
****

The error is ambiguous at best but I believe the second scenario is what is
happening given the consistent time before clicking "Retry" is accepted
without error.

I have posted the information received so far to the developers however, I'm
not expecting the application to be corrected/changed in a hurry as
ATTACH/DETACH are unusual events in user scripts.

So the question remains:
Is there a way to check for open transactions / locks from the command line?


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dennis Cote
Sent: Tuesday, 27 May 2008 11:23 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Checking for open transactions attach/detach database

MoDementia wrote:
> The database file is ready to (copy) Detach as soon as the commit
completes.
> 

Yes.

> This is the problem.
> Detach: "This statement will fail if SQLite is in the middle of a
> transaction."

This is true. This is why you must commit your transaction before you 
can detach.

> If I commit 10k row updates I cannot detach the database until it is
> finished.
> 

The database (SQLite) will be finished all its processing by the time it 
returns to your program after executing the commit statement.

   Attach
     Begin
       Loop to insert many rows
     Commit
   Detach

> I need to be able to check some sort of table entry that will be clear
once
> the commit is finished.

The commit is finished when it returns to your program.

> 
> I don't have access to any of the higher level functions so it needs to be
> something like
> 
> SELECT Commit_Status FROM Active_Transactions
> 
> Then I can wait till Commit_Status = something
> Before I attempt to DETACH the database
> 
> Obviously the application (written in some C language) can tell that it is
> still committing and throws the error
> But I need to do this check from the command line only

The same logic applies to the command line. It has completed its 
processing by the time it displays the prompt after you enter the commit 
command.

> 
> I hope this is making sense
> 

Sort of. It seems like you are worrying about a non issue.

HTH
Dennis COte
_______________________________________________
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

Reply via email to