Using GenericDatabase with ODP.NET and System.Transactions

Dec 15, 2008 at 2:11 AM
Edited Dec 15, 2008 at 4:38 AM

I am using ODP.NET with the DbProviderFactory and GenericDatabase class and it is working very well. eg.

DbProviderFactory dbFactory = DbProviderFactories.GetFactory("Oracle.DataAccess.Client");
GenericDatabase database = new GenericDatabase("connectionstring...", dbFactory);

However, I am unclear on how best to use transactions with the GenericDatabase. I want to take advantage of the Database.UpdateDataSet (DataSet, String, DbCommand, DbCommand, DbCommand, DbTransaction) helper method.  Oracle.DataAccess.Client.OracleTransaction implements DbTransaction so this is an option. But ODP.NET also supports System.Transactions so I expect I can just make any calls in a TransactionScope as usual.
Which way is best? OK, I'm sure the answer starts with "It depends..." but any comment would be welcome!


Dec 15, 2008 at 6:18 AM
I've just come across this thread, see if it helps...

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
Sep 4, 2013 at 3:14 PM
Any full source code sample ?