Skip to Content.
Sympa Menu

freetds - Re: Can not execute two sentences into the same transaction!

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Rich McAneny" <rich AT inskey.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: Can not execute two sentences into the same transaction!
  • Date: Mon, 26 Feb 2001 12:18:47 -0500


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.




Archive powered by MHonArc 2.6.24.

Top of Page