Re: Using ADODB(MS ActiveX Data Objects) with C#, transaction problem.
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Mon, 5 Mar 2007 09:06:47 -0600
"Rafael F." <RafaelF@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E05B81E4-0DA2-46AB-877F-BBE25DCC413D@xxxxxxxxxxxxxxxx
I´m trying to use an ADODB Connection (from Microsoft ActiveX Data Objectscreate a
2.8 or 6.0 none worked) to make a connection to a oracle9i database,
table, then commit or rollback the transaction.requiredobject,
The problem is that the transaction I open is being ignored, and the
commands I execute are all being commited immediately.
The code I´m using is the following.
ADODB.Connection con = new ADODB.ConnectionClass();
con.ConnectionString =
"Provider=OraOLEDB.Oracle.1;Password=test_pass;Persist Security
Info=True;User ID=test_use;Data Source=DB_045";
con.Open(null, null, null, -1);
con.BeginTrans(); //begintrans is returning 1 as expected
object requiredobject;
con.Execute("CREATE TABLE TEST (NRFILE AS NUMBER(10))", out
(int)CommandTypeEnum.adCmdText); // when this line is executed itimmediately
commits the create table
con.RollbackTrans();//and rollback here does nothing
con.Close();
AFAIK, in Oracle anyway, "DDL statements" will always commit a transaction
even if part of other DML statements. Only "SQL" is held up pending a
commit.
But this is likely Oracle version and provider dependent.
-ralph
.
- Prev by Date: Re: Using ADODB(MS ActiveX Data Objects) with C#, transaction problem.
- Next by Date: ado buit-in functions
- Previous by thread: Re: Using ADODB(MS ActiveX Data Objects) with C#, transaction problem.
- Next by thread: ado buit-in functions
- Index(es):
Relevant Pages
|