Can not execute two sentences into the same transaction!
Rich McAneny
rich at inskey.com
Mon Feb 26 12:18:47 EST 2001
I have a similar(?) issue regarding committing transactions. However, the
answer below regarding isolation levels is not a good one. If you change
the level to READ_UNCOMMITED then can't everyone see your changes even
before they are committed? Possibly having someone read your partial
changes?
Anyway...
(FYI: The following works with the JDBC-ODBC bridge and the MS SQL Server
ODBC driver)
I set autocommit=false.
I have 2 inserts to 2 different tables. The 2nd table has a foreign
constraint on it with the first table. (i.e table one record must exist
before table 2 record). I successfully insert to table 1, then when trying
to insert to table 2, the executeUpdate() method hangs.
If I turn autocommit on, everything is ok. ALSO, if I remove the
restraint, everything works fine. I do not want to do either of these.
I DID get around this problem by sending in both inserts in one statement
(this also works for the update/select problem in the previous email), but
I thought I'd let you know about this potential bug.
Thanks,
Rich
> Thanks!!, I know transaction isolation levels. I've tried with
> READ_UNCOMMITED and works. The default level is READ_COMMITED in this way
> i can't read rows from tables with transactions not commited yet.
>
> Thanks.
More information about the FreeTDS
mailing list