This is good for my case, basically I just need to commit whenever I want
the current transaction to end, and a new one will begin.
The "commit and rollback" section of the manual mentions this in the
context of models, controllers, views and modules, but the scheduler is a
special case of model, so I wasn't sure. Thanks for the clarification.
On Tuesday, February 2, 2016 at 1:43:53 PM UTC-6, Niphlod wrote:
>
> 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.