Re: Using ADODB(MS ActiveX Data Objects) with C#, transaction problem.




"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 Objects
2.8 or 6.0 none worked) to make a connection to a oracle9i database,
create a
table, then commit or rollback the transaction.
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
requiredobject,
(int)CommandTypeEnum.adCmdText); // when this line is executed it
immediately
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



.



Relevant Pages

  • RE: Slow connection to Oracle 9i
    ... A commit() should be issues only when necessary - the cost in the database of a commit is large and doing so in this random fashion is an invitation to other performance problems. ... Slow connection to Oracle 9i ... do not get a transaction too long error (can't remember exactly what its ...
    (perl.dbi.users)
  • RE: Slow connection to Oracle 9i
    ... Slow connection to Oracle 9i ... Commit is the cheapest thing you can do in Oracle. ... The reason is that oracle ASSUMES the transaction is going to be committed, ...
    (perl.dbi.users)
  • RE: Slow connection to Oracle 9i
    ... we commit every 1000 or every 10000 rows. ... Slow connection to Oracle 9i ... transaction, and then committing after every row. ...
    (perl.dbi.users)
  • Re: ASSM bug: slow INSERT after uncomitted DELETE
    ... In general a commit should be used ... along the logical transaction, and there are certainly cases where you ... available (unusable indexes, truncate, optionally nologging, direct- ... SQLTools++ for Oracle: ...
    (comp.databases.oracle.server)
  • Re: Managing transations involving thousands of records
    ... A commit means just writing a commit marker in the redo log, ... Also there is something like a *logical* transaction. ... >implement it but it sounds like pretty intensive for the database. ... Starting from Oracle 9i, ora-1555 ...
    (comp.databases.oracle.server)

Quantcast