session is not the database. you can save the transactionid into the session and update the db in the controller. e.g.
id = db.transactions.insert() session.transaction = id db(db.transactions.id == session.transaction).update(x=y) or you can manage transaction record in the session and update the db at the last step e.g. from gluon.storage import Storage id = db.transaction.insert() session.transaction = Storage() session.transaction.id = id session.transaction.otherfield = x ..... session.transaction.otherfield = y db(db.transaction.id == session.transaction.id).update(otherfield = session.transaction.otherfield) In any case, if you save something to session and you want that change saved into the database, you have to do a specific update using db(...).update()

