Am Mittwoch, 20. August 2014 17:59:29 UTC+2 schrieb viniciusban:
>
> Inline answers. 
>
> On Wed, Aug 20, 2014 at 12:49 PM, Jan Beilicke <[email protected] 
> <javascript:>> wrote: 
> > (second try, somehow my post wasn't published) 
> > 
> > ... 
> > 
> > According to the reference [1] the counter should be rolled back when 
> db.rollback() is called. 
>
> The autoincrement column (id) is controlled by the RDBMS. You should 
> not consider it's a clear e consecutive sequence of integers. 
> The rollback avoids the actual inserts/updates or deletes. 
>
> Imagine 2 users doing what you tried concurrently. Which id would be 
> assigned to each record? 
>
 
Thanks for pointing me to the underlying RDBMS. I ran the same lines with 
an SQLite database and this time the counter was rolled back. The MySQL 
approach makes sense to avoid concurrency issues.

-- 
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.

Reply via email to