On Mon, Jun 18, 2012 at 2:07 AM, Anthony <abasta...@gmail.com> wrote:
> I don't think web2py is doing any magic -- I think it just relies on the
> standard database and database driver behavior.

"There in lies the rub" - the problem is that The Book isn't really
very easy to use to find out just what the DAL does for each DB and
what "shows through" as the behaviour of the underlying DB.

That is, The Book isn't really a reference manual, which is fine, but
it also leaves me wondering if there is something the DAL does but
that I just haven't found/remembered the right part of the The Book to
find it.

....

> A commit closes the open transaction, but it doesn't cause the db to lock
> again immediately. A new transaction doesn't really start until another
> insert/update/delete statement is issued.
>
> For more on SQLite locking, seeĀ http://www.sqlite.org/lockingv3.html.

Thanks!
I guess the issue here is that I don't really want to tie my code (or
the example in The Book) to any one DB, but there are DB "quirks"
which manage to show through, and as a new Web2py user, its hard to
build up a model of what the DAL does and what leaks through. :-)

For example, the content at the link you provided ends with "7.0
Transaction Control At The SQL Level" and talks about autocommit mode
vs. "out of autocommit mode". I searched The Book for "autocommit" and
found nothing. I also searched for SQLite and didn't find anything
mentioning that (that I was able to recognize).

Given the "commit at the end of a request" model that Web2py does, I
might guess that autocommit is being disabled?

It matters because with autocommit off, SELECTs will acquire SHARED lock.
If I am reading things correctly, that might cause this server script
to block any writes/updates from the Web2py app.

Specifically, if the server does not find any records to update (i.e.
no work to do), the query/SELECT it does to find work items would
provoke a SHARED lock, but with no records to update the server won't
do a commit (or anything else that i can see) that would drop that
lock?

Thanks,
-Doug

Reply via email to