PC Review


Reply
Thread Tools Rate Thread

Commits or rollbacks issued following each select

 
 
Jim
Guest
Posts: n/a
 
      8th Dec 2005
I have an application that uses the direct provider for Oracle to
connect to an Oracle database server. While looking at Oracle trace
files, I discovered something that bothers me. The following
pseudo-code describes the problem.

string statement = "Select fielda, fieldb from tablea where fieldc =
:Param1";

DbCommand.CommandType = CommandType.Text;
DbCommand.CommandText = statement;
DbCommand.Connection = current connection;
DataAdapter.SelectCommand = DbCommand;
try
{
DataAdapter.Fill(dataTable);
}
etc...

This is a simple select on a non-unique field that returns zero or more
rows. It works fine. However, when I look at the Oracle trace files,
after the last fetch, I see:
XCTEND rlbk=1, rd_only=1

Sometimes rlbk = 0, other times it is as above. This is telling Oracle
do do a commit or rollback on the read. I am not in a transaction. This
appears to happen with all reads, none of which were in an explicit
transaction.

I have seen references to this behavior elsewhere, but have found no
way to disable it. I tried both the MS and Oracle data providers, with
no apparent change in behavior. It's wasting time on the app server,
network and database server. Can anyone tell me how to disable this
"feature"?

Thanks in advance,

Jim Brandley

 
Reply With Quote
 
 
 
 
David Browne
Guest
Posts: n/a
 
      8th Dec 2005

"Jim" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have an application that uses the direct provider for Oracle to
> connect to an Oracle database server. While looking at Oracle trace
> files, I discovered something that bothers me. The following
> pseudo-code describes the problem.
>
> string statement = "Select fielda, fieldb from tablea where fieldc =
> :Param1";
>
> DbCommand.CommandType = CommandType.Text;
> DbCommand.CommandText = statement;
> DbCommand.Connection = current connection;
> DataAdapter.SelectCommand = DbCommand;
> try
> {
> DataAdapter.Fill(dataTable);
> }
> etc...
>
> This is a simple select on a non-unique field that returns zero or more
> rows. It works fine. However, when I look at the Oracle trace files,
> after the last fetch, I see:
> XCTEND rlbk=1, rd_only=1
>
> Sometimes rlbk = 0, other times it is as above. This is telling Oracle
> do do a commit or rollback on the read. I am not in a transaction. This
> appears to happen with all reads, none of which were in an explicit
> transaction.
>
> I have seen references to this behavior elsewhere, but have found no
> way to disable it. I tried both the MS and Oracle data providers, with
> no apparent change in behavior. It's wasting time on the app server,
> network and database server. Can anyone tell me how to disable this
> "feature"?
>


In Oracle you are always in a transaction. Autocommit mode is emulated by
issuing a commit after each statement.

David


 
Reply With Quote
 
Jim
Guest
Posts: n/a
 
      8th Dec 2005
I really do not want autocommit. Is there a way to turn it off?

 
Reply With Quote
 
Jim
Guest
Posts: n/a
 
      8th Dec 2005
I really do not want autocommit. Is there a way to turn it off?

 
Reply With Quote
 
Jim
Guest
Posts: n/a
 
      8th Dec 2005
I really do not want autocommit. Is there a way to turn it off?

 
Reply With Quote
 
David Browne
Guest
Posts: n/a
 
      8th Dec 2005

"Jim" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I really do not want autocommit. Is there a way to turn it off?
>


Just use explicit transactions (or System.Transactions in ADO.NET 2.0) in
your ADO.NET code. All ADO.NET data providers default to autocommit mode.

David


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Commits and Rollbacks =?Utf-8?B?UGVnZ3k=?= Microsoft Access Form Coding 9 16th Nov 2007 03:11 PM
ADO.NET rollbacks Greg Microsoft C# .NET 2 27th Jul 2007 05:43 PM
Multithreading and RollBacks wdewebserver Microsoft Dot NET Framework 4 23rd Nov 2004 07:31 PM
Rollbacks, how to repair them ? Husky Windows XP New Users 0 21st Oct 2004 03:07 PM
updates and rollbacks? =?Utf-8?B?QnVE?= Microsoft Windows 2000 2 17th Oct 2003 01:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:43 PM.