Skip to Main Content

Oracle Database Discussions

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!

Why must commit after select to close database link

oraLaroOct 15 2014 — edited Oct 20 2014

11.2.0.4

I have a performance problem in  sessions that have been open for some time that have issued queries that use database link.  

Session runs,

query that uses dblink

<some time later new query issues, could be waiting minutes for return>

I can see the wait event is waiting on dblink.   but theres no reason for it to be waiting (remote DB is fine, and says session from link is ok) so in lieu of me finding that problem, Im going to force a close of the database link after each link query.

alter session close database link <dblink>;

But I get the ora-02080 link is in use, so I have to issue a commit to get the link to close. (I can replicate this in  sqlplus).  John spencer says this is expected behaviour here

Problem is some of the code is embedded in java applications and I might not always want to do a commit at that time.

So question is why is the commit necessary?

This post has been answered by oraLaro on Oct 15 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 17 2014
Added on Oct 15 2014
25 comments
11,432 views