Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Remote Select opening transaction

RE: Remote Select opening transaction

From: Bobak, Mark <Mark.Bobak_at_il.proquest.com>
Date: Tue, 3 Apr 2007 09:16:29 -0400
Message-ID: <AA29A27627F842409E1D18FB19CDCF270BD0A72D@AABO-EXCHANGE02.bos.il.pqe>


No, Marc is correct. When you do a select across a database link, it initiates a distributed transaction. I believe this is to deal with two-phase commit, and to guarantee that Oracle can deal the implications of distributed transaction.  

One way to avoid this transaction being opened is to initiate a read only transaction.  

Here's a quick demo on 9.2.0.8:  

SQL> select vt.used_ublk from v$transaction vt, v$session vs where vs.sid =(select sid from v$mystat where rownum=1) and vs.taddr=vt.addr;  

no rows selected  

SQL> select * from dual_at_pqd <mailto:dual_at_pqd> ;  

D
-

X  

SQL> select vt.used_ublk from v$transaction vt, v$session vs where vs.sid =(select sid from v$mystat where rownum=1) and vs.taddr=vt.addr;  

 USED_UBLK


         1  

SQL> rollback;  

Rollback complete.  

SQL> set transaction read only;  

Transaction set.  

SQL> select vt.used_ublk from v$transaction vt, v$session vs where vs.sid =(select sid from v$mystat where rownum=1) and vs.taddr=vt.addr;  

no rows selected  

SQL> select * from dual_at_pqd <mailto:dual_at_pqd> ;  

D
-

X  

SQL> select vt.used_ublk from v$transaction vt, v$session vs where vs.sid =(select sid from v$mystat where rownum=1) and vs.taddr=vt.addr;  

no rows selected  

SQL> select * from v$version;  

BANNER



Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production PL/SQL Release 9.2.0.8.0 - Production
CORE 9.2.0.8.0 Production
TNS for Solaris: Version 9.2.0.8.0 - Production NLSRTL Version 9.2.0.8.0 - Production  

-Mark
 

--

Mark J. Bobak
Senior Oracle Architect
ProQuest/CSA

"There are 10 types of people in the world: Those who understand binary, and those who don't."  


From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Kerber, Andrew W. Sent: Tuesday, April 03, 2007 8:25 AM
To: marc.demlenne_at_gmail.com; oracle-l_at_freelists.org Subject: RE: Remote Select opening transaction

Hi. I am pretty sure your information is incorrect. I have never seen a select across a db link open a transaction.  

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Marc Demlenne Sent: Tuesday, April 03, 2007 7:08 AM
To: oracle-l_at_freelists.org
Subject: Remote Select opening transaction  

Hello,

In Oracle 8, when performing a select query on another database threw DB link, Oracle opens a transaction that could only be closed by commit or rollback. That could be harmful when developers are not aware of this and don't close transaction. (leading to ORA-01562.)

What is the reason of this behaviour ? Is there some docs / faq explaining this ?
Is this feature also common to later versions of Oracle ?

Thanks a lot for any piece of information given,

--

Marc




NOTICE: This electronic mail message and any attached files are confidential. The information is exclusively for the use of the individual or entity intended as the recipient. If you are not the intended recipient, any use, copying, printing, reviewing, retention, disclosure, distribution or forwarding of the message or any attached file is not authorized and is strictly prohibited. If you have received this electronic mail message in error, please advise the sender by reply electronic mail immediately and permanently delete the original transmission, any attachments and any copies of this message from your computer system. Thank you.

--

http://www.freelists.org/webpage/oracle-l Received on Tue Apr 03 2007 - 08:16:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US