From: Ian B. <ia...@co...> - 2003-04-29 09:35:48
|
On Tue, 2003-04-22 at 23:48, Peter Wilkinson wrote: [snip] > The autoCommit=1 and the pooling conditional is just copied directly > from PostgresConnection, SQLite supports transactions so I presume that > for the same reasons this is needed. Okay, applied to CVS. > I changed how it deals with getting a connection so that code like the > following will work without needing to turn the results into lists, > really any code where you have database access inside loops like this > not just deletes. > > users = User.select('all') > for i in users: > for ul in u.userLocations: > ul.destroySelf() > > SQLite + Python only supports one connection at a time. In my > understanding the select loop should be able to run in a different > connection to the delete as SQLite only locks when changing the db. I'm > trying to find out exactly where the oddness is happening. > > Can you see any problems with doing this? Yes, that seems to work. I don't know enough about the SQLite and concurrency to really know, but if it works then its fine with me. I wonder if it works okay with transactions... Ian |