Doc/doc patch is always most welcome :)
On 2010-4-11 Sun 04:07:40, MDOOTSON wrote:
Show quoted text> Hi,
>
> Just an update. Your solution seems to be absolutely the best one.
I've
Show quoted text> tested it against contrived locking conflicts with multiple attached
> database files in addition to the lock escalation issue, versus
catching
Show quoted text> the SQLITE_BUSY messages in my own code and the plain fact is that
> SQLite's inbuilt busy-timeout (which 'begin immediate tran' always
> brings into play) seems always more efficient than rollback and
retrying
Show quoted text> in your own code. I can imagine a situation where many readers are
> locked out by a single long running transaction but my (limited)
testing
Show quoted text> suggests it is still quicker to use the inbuilt busy callback via
'befin
Show quoted text> immediate tran'.
>
> May I suggest that you change the POD. The issue regarding 'pending
> locks' being left around only existed in SQLite versions >3.2.8 and <
> 3.4.0. The POD also seemed to suggest (to me at least) that it
matters
Show quoted text> how other processes are accessing the db file. It does not. This
might
Show quoted text> be an issue if sqlite 'cached' access were being used - but as it is
not
Show quoted text> used in DBD::SQLite, I only went as far as confirming that clients
not
Show quoted text> using cached access are unaffected by what happens in the cache
clients.
Show quoted text>
> Also, you may like to consider making 'begin immediate transaction'
the
Show quoted text> default for $dbh->begin_work. In any situation where there is
> concurrent access, the current default 'deferred' mode will cause
> SQLITE_BUSY errors that you have to write code to handle, whereas
'begin
Show quoted text> immediate transaction' will always work. Any benefit you might get
from
Show quoted text> deferring your RESERVED lock only lasts until the first
> insert/delete/update statement in your transaction anyway.
>
> You might also like to remove 'begin exclusive transaction' as a
> suggestion, or at least make clear it isn't a preferred option. Just
as
Show quoted text> 'begin immediate' appears to have no real-world downside, 'begin
> exclusive' seems to have no real world benefit with quite a lot of
> potential downside. (Though I have not tested the real impact).
>
> As I currently understand the SQLite locking process v's transactions
> reasonably well, but it will all fall out of my head by next week,
would
Show quoted text> you appreciate a DBD::SQLite::Transactions.pod ?
>
> Thanks very much for your work on DBD::SQLite
>