On Apr 25, 2013, at 2:43 PM, sajuptpm <[email protected]> wrote:
> Hi,
>
> Suppose we have two transactions T1 and T2. Both transactions trying to
> update same row ROW1.
>
> Suppose both transactions are started simultaneously.
>
> T1 first updated ROW1 and commit it.
>
> In my case T2 not getting the update done by T1.
>
> If run commit in T2 and query ROW1 again, then I can see the commit done by
> T1.
>
> In a transaction, do we need to run commit and query again to get change done
> by another transaction ???
>
> Any other way to sync these transactions ??
T2 doesn't see T1 likely because you have repeatable read isolation turned on -
T2 won't see new updates to rows that it's already selected from.
If you want two simultaneous transactions to work in serial, that's what
serializable isolation is for.
SQLAlchemy provides an interface to set isolation levels using the
"isolation_level" execution option, either on an Engine:
e = create_engine(..., execution_options={'isolation_level': 'SERIALIZABLE'})
conn = e.connect()
conn = conn.execution_options(isolation_level='SERIALIZABLE')
isolation_level is not supported on all dialects. It will work only on
Postgresql and MySQL, and works partially with issues on SQLite.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.