> > I'm looking for The Book to tell me what to expect. > If it doesn't tell me, then I don't know if the current behaviour > (once I discover it) will be carried forward to future versions of > Web2py as part of the backwards compatibility promise, or, if the > current behaviour is just a quirk of the current implementation that > might change and which could bite me if I rely on it. >
> Can I count on the DAL setting or not setting autocommit mode? How do > I have any way of knowing if changing that "behind the DAL's back" > would break anything or not. Does the DAL even care? > > Since the DAL is trying to abstract away details about particular DB > engines so that Web2py users can write code that "doesn't care", it > also needs to say (for each DB Engine) what assumptions it is > making... that is, what matters to it and what doesn't. It's perfectly > fine to say, for each DB Engine, what configurations/settings/etc. > that Web2py 'cares about' and which it doesn't. > Can you explain how whether SQLite autocommits or not matters in this case? The DAL documentation recommends doing a db.commit() in scripts and background tasks like this precisely because it doesn't want to assume any autocommitting is happening. Within the context of HTTP requests, web2py automatically does a commit at the end of the request. It's not clear the documentation needs to say anything else here -- if you follow what the documentation currently says, you should be fine. Anthony