Inline answers.

On Wed, Aug 20, 2014 at 12:49 PM, Jan Beilicke <[email protected]> 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?

>
> In [89]: db().select(db.foo.ALL)
> Out[89]: <Rows (1)>
>
>
> In [90]: [rec.id for rec in db().select(db.foo.ALL)]
> Out[90]: [3L]

This is the important part: only one line in your table. ;-)

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