On Sun, Sep 1, 2013 at 6:53 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 1 Sep 2013, at 10:34pm, C M <cmpyt...@gmail.com> wrote:
>
> > Do you know how I can do that with Python?  For example, I tried this:
> >
> > status = cursor.execute("some SQL statement here")
> > print "The status is: ", status
> >
> > But it prints the cursor object:
> >
> >> The status is <sqlite3.Cursor object at 0x034313B0>
>
> Does the cursor object have properties ?  Can you either look through them
> in a debugger or find documentation somewhere that tells you if one of them
> is something like 'last error' ?
>
> There should be a way to do it: the ability to read the code returned by
> API calls is essential to using SQLite properly.
>

I don't know.  I am looking into this, and may consider trying APSW as the
wrapper instead of pysqlite2 (see Roger Binns's post) to see if I can get
that information.

With regard to your other posts about this problem, my guess is that you
> have some underlying error causing this that isn't part of SQLite.  The
> expected cause of this error is if someone deletes your database file (or a
> journal) while you have the database open.  There are other errors which
> can make the file handle invalid.  But I suspect that just as you wrote
> about your RAM, you actually have a hardware or OS problem which is the
> real culprit.
>

That very well may be, but I want to be able to respond appropriately in
the application if this happens to a user, who may also have a similar
hardware problem (in that PCs that run slow or are bogged down with RAM use
from Firefox, e.g., are incredibly common).

One "hypothesis"  (this is totally naive, so may be really off base) I have
is that if the CPU use / RAM use is high, then the various processes are
not getting their chance to write to the hard drive, and so if SQLite tries
to write it is put in a queue and is getting "timed out".  Then, if I try
again in a few seconds, now the other processes have had a chance to write
and SQLite gets write access right away.  If that is the case, that seems
like something that can be worked around...I'm just not sure how to
determine if it is the case and how to work around it if it is.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to