PC Review


Reply
Thread Tools Rate Thread

AutoCommit - Oracle.

 
 
=?Utf-8?B?SmltIEhlYXZleQ==?=
Guest
Posts: n/a
 
      14th Feb 2005
If you call a stored procedure which is an update procedure, is it
autocommitted by default?

Is the same true for an Oracle Stored procedure?

If you call an Oracle Stored procedure with the defaults for the connection,
and the stored procedure has a rollback, I am getting an error which
indicates that I can not do a rollback on a distributed transaction. How can
I call a stored Oracle Procedure and be able to issue a rollback within the
stored procedure without getting and error in ADO.Net when I do this?
 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      14th Feb 2005
Hi Jim,

If you have a rollback in your stored procedure you would need a begintrans
also.
I really don't see having begintrans somewhere and rollback elsewhere.
It is a bad practice unless I am missing something.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
SLODUG - Slovene Developer Users Group www.codezone-si.info

"Jim Heavey" <(E-Mail Removed)> wrote in message
news:952C3345-E03B-4E85-B600-(E-Mail Removed)...
> If you call a stored procedure which is an update procedure, is it
> autocommitted by default?
>
> Is the same true for an Oracle Stored procedure?
>
> If you call an Oracle Stored procedure with the defaults for the
> connection,
> and the stored procedure has a rollback, I am getting an error which
> indicates that I can not do a rollback on a distributed transaction. How
> can
> I call a stored Oracle Procedure and be able to issue a rollback within
> the
> stored procedure without getting and error in ADO.Net when I do this?



 
Reply With Quote
 
=?Utf-8?B?SmltIEhlYXZleQ==?=
Guest
Posts: n/a
 
      14th Feb 2005
I guess I always thought the Oracle stored procedures should be self
contained for anyone who wanted to use them...so if I was using Toad on SQL+
and invoked the stored procedures, the user would not have to worry about
having to have to commit the transaction.

So if I was looking for this, then it would seem that I would have to
support 2 versions of the procedures....

 
Reply With Quote
 
Eric
Guest
Posts: n/a
 
      15th Feb 2005
Jim Heavey wrote:
> I guess I always thought the Oracle stored procedures should be self
> contained for anyone who wanted to use them...so if I was using Toad on SQL+
> and invoked the stored procedures, the user would not have to worry about
> having to have to commit the transaction.


This is incorrect. Oracle never autocommits. TOAD has a configuation
setting to indicate if you want it to commit when you exit, but there is
no autocommit in TOAD until you exit.

I never knew Sqlplus to autocommit, but I haven't used it in a few years
so I can't comment on it.

SQL Server has always had a database option for this because it came
from Sybase.

Unlike SQL Server, Oracle is always in a transaction...COMMIT or
ROLLBACK ends the current tranaction and starts the next one.

When it comes to SPs, you should have 2 types of SPs: those with an
external interface can be used to control transactions, but those that
are only internal should not be used to control transactions.

If you use ADO.NET you have to pay close attention to who controls each
transaction.

It's critically important if you have linked DBs and distributed
transactions (updates accross DB boundaries).

Eric
 
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
Sequence.nextval numeric type in Oracle 10g differs from Oracle 8i when using MS OleDb provider alasdair.johnson@gmail.com Microsoft ASP .NET 0 27th Apr 2007 05:57 PM
Pass an array to an Oracle stored procedure using Microsoft's client for Oracle michelle.m.talt@gmail.com Microsoft ADO .NET 0 16th Jun 2006 04:34 PM
How to Autocommit mode off =?Utf-8?B?TmVlbGFt?= Microsoft Dot NET 0 27th Sep 2004 09:37 AM
How to connect oracle 8i when oracle 8i and oracle 9i installed in one system Prasad Microsoft ADO .NET 0 1st Dec 2003 10:23 AM
Insert query in Oracle database using microsoft ODBC for oracle =?Utf-8?B?UmVuYXRvIE0uIFYuIEIu?= Microsoft Access VBA Modules 1 16th Nov 2003 11:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:34 AM.