you have only one transaction at your disposal per connection...
every command you send down the pipe gets queued and the queue can be
commit()ted or rollback()ed.
This queue of commands (in regards of multiple write operations,
(update/insert/delete)) is atomically "executed" though a transaction, once
you commit() it.
once you db.commit() (or rollback()), another "queue" is "opened"
implicitly.
if you need to treat two separate "queues" of commands, and retain the
possibility to commit() both, or one, or none, or rollback() both, or one,
or none, you NEED to use two different connections (i.e. db = DAL('....')
and db2 = DAL('...'))
On Tuesday, February 2, 2016 at 6:59:55 PM UTC+1, Antonio Salazar wrote:
>
> I have a scheduled task that midway should divide its work in two database
> transactions.
>
> It's obvious it should db.commit() after the first transaction, but how do
> I start the second transaction?
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.