DAL without web2py

I am using web2py to connect my website. I decided to use web2py DAL for a long-term program that works behind the site. This program does not seem to update its data or database (sometimes).

from gluon.sql import *
from gluon.sql import SQLDB

from locdb import * 
# contains
# db = SQLDB("mysql://user/pw@localhost/mydb", pool_size=10)
# db.define_table('orders', Field('status', 'integer'), Field('item', 'string'),
#    migrate='orders.table')
orderid = 20 # there is row with id == 20 in table orders
#when I do 
db(db.orders.id==orderid).update(status=6703)
db.commit()

It does not update the database, and choosing in order with this identifier shows the correct data. In some cases, "db.rollback ()" after commit seems to help.

Very strange, to say the least. Did you see it? More importantly, do you know the solution?


UPDATE:
Bugfix: The choice in a question is made inside the program, and not outside it.

, , , . , , , .

, ?

+5
1

: mysql REPEATABLE READ ( , , , , ). . , READ COMMITED - , Oracle mssql . my.cnf. :

http://dev.mysql.com/doc/refman/5.1/en/set-transaction.html

+2

All Articles