Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

SOS -ODP .NET Different Database Type Transaction

991643Feb 18 2013
Hi,EveryOne:
I want to use ODP.net Instead of Ado.NET .But a transaction problem Puzzle me.
The Detail code is
string xmldata = "<data>nihao </data>";
using (TransactionScope scope = new TransactionScope())
{

string sql = string.Empty;
for (int i = 1; i <= 300; i++)
{
sql = "insert into Test(id,ChineseCode,EnglishCode) select '" + Guid.NewGuid().ToString() + "','" + Guid.NewGuid().ToString() + "','" + Guid.NewGuid().ToString() + "'";
SqlFunction.ExecSql(sql);
}
sql = " delete from Test123 ";
OraFunction.ExecSql(sql);
sql = "insert into Test123(id,code,data) select '" + Guid.NewGuid().ToString() + "','001','" + xmldata + "' from dual ";
for (int i = 1; i <= 300; i++)
{
OraFunction.ExecSql(sql);
}
scope.Complete();
}

The problem is
I find sql = " delete from Test123 "; may be not execute,
but if only oracle database sql, delete sql can right execute
the same code use ado.net system.oracle delete sql can right execute too
who can explain the reasons? Thanks!

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 18 2013
Added on Feb 18 2013
0 comments
133 views