[TransWarp] Strange EntityDM behavior

Phillip J. Eby pje at telecommunity.com
Tue Oct 7 22:59:40 EDT 2003


At 06:47 PM 10/7/03 -0700, John Landahl wrote:
>On Tuesday 07 October 2003 01:32 pm, Phillip J. Eby wrote:
> >
> > It doesn't work "either way", actually.  Your code uses app.db() for the
> > query at the end, which fails with an "OperationalError: database locked",
> > because the TableDM is using its own DB connection.  Thus, there are two
> > connections with ongoing transactions to the same file, which SQLite
> > doesn't allow.
>
>Ah, alright.  That would explain why nothing was saved to the database in the
>test program, which wasn't a problem in my actual application.  I didn't see
>any exceptions or failures, though.  Where did you see the OperationalError?

At the end, when it does the 'select'.  The App.db object issues a 
begin-transaction at the time of the select, and SQLite complained that the 
DB was already locked (by the TableDM's db connection).

My tests were run on Windows, though, so maybe I had different semantics in 
effect than for your test.  Anyway, once I changed the TableDM to Obtain() 
the shared db connection, the locking error went away.




More information about the PEAK mailing list