I\'m confused. On the face of it, performing a transaction in C# seems simple. From here:
http://docs.oracle.com/cd/B19306_01/win.102/b14307/OracleTransactionClass.htm
1) do I need to set the Transaction property of my OracleCommand,
No.
and if so, what exactly does this do?
It's a no-op.
The OracleCommand
automatically "reuses" the transaction that is currently active on the command's OracleConnection
. The Transaction
property is there simply because it was declared in the base class (DbCommand
) and you cannot "undeclare" a member in the inherited class. If you read it you'll get the connection's transaction (if any), setting it does nothing.
2) If I've started a transaction on a connection, are ALL subsequent commands performed on that connection (until a commit or rollback) part of that transaction, even if I don't set the Transaction property on those commands?
Exactly.