(second try, somehow my post wasn't published)
Hi all,
since a long time I have the opportunity to work on a web2py project again
- it was about time!
To refresh my mind I was tinkering with DAL and a MySQL database in an
iPython shell and I was wondering: According to the reference [1] the
counter should be rolled back when db.rollback() is called. Somehow I can't
confirm this statement:
In [81]: db = DAL('mysql://host:3306/mydb', pool_size=1, check_reserved=[
'mysql'], lazy_tables=False)
In [82]: db.define_table('foo', Field('name', 'string'))
Out[82]: <Table foo (id,name)>
In [83]: db.foo.insert(name='entry1')
Out[83]: 1L
In [84]: db.rollback()
In [85]: db.foo.insert(name='entry1')
Out[85]: 2L
In [86]: db.rollback()
In [87]: db.foo.insert(name='entry1')
Out[87]: 3L
In [88]: db.commit()
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]
Am I missing something? Is the behavior depending on the used database?
Kind regards,
//jotbe
[1] http://web2py.com/books/default/chapter/29/6
--
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.