HI all,

I am having trouble with the autoflush functionality. From the SA
documentation: "Database operations will be issued in the current
transactional context and do not affect the state of the transaction.
You may flush() as often as you like within a transaction to move
changes from Python to the database’s transaction buffer."

This basically means that the transaction is still ongoing and the
changes are buffered at the db side rather than in the SA session
state, right? So I should still be able to commit/rollback changes..

What I see with mysql is closer to autocommit behavior. A simple
example:

    session.add(Obj(5))
    print session.query(Obj).all()
    session.rollback()

What I observe with sqlite is that the print statement prints the
added Obj, however after the program is done, there is no trace of Obj
(5) in the sqlite database. This is expected.

With mysql however, the insert done by the query() actually does a
commit.. i turned on echo, and i dont see an explicit commit but this
is what seems to happen.. After the program is done, I can see Obj(5)
in the mysql database.

Is this a known problem? Or am I doing something wrong here?

Thanks!

--

You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.


Reply via email to