On Thu, 2006-06-22 at 14:31 -0700, Rick Keiner wrote: > After some problems I was having with "cannot start a transaction > within a transaction" problem with SQLite3, I came across this and I > think a check should go in the transaction handling for busy > conditions in the end transaction. > > http://www.mail-archive.com/[email protected]/msg15985.html
Finally got some time to experiment with this. Under high concurrency of transactions (20 threads, both read and update transactions from all threads), it is much better to have BEGIN IMMEDIATE or BEGIN EXCLUSIVE at the start of the transaction and then handle transaction failures by the caller. Starting a transaction blindly and then waiting around in query/select (basically in a deadlock) was almost 20% performance loss in my tests. Maybe we should introduce APR_DBD_TRANSACTION_IMMEDIATE/EXCLUSIVE modes to tell SQLite3 what we really want? This would have no effect on other drivers, of course. -- Bojan
