Forum Stats

  • 3,876,226 Users
  • 2,267,082 Discussions


Can this code cause a connection leak? Row r = viewObject.first();

Pamela Member Posts: 203 Bronze Badge

JDeveloper Version

Often in my application instead of using the following code:

ViewObject vo = am.getMonthlyWeeklyDhrSumView1();


RowSetIterator rsIterator = vo.createRowSetIterator(null);


Row row = rsIterator.first(); //use the first row after that...


I am using the following code to get the first row of a view object:

ViewObject vo = am.getMonthlyWeeklyDhrSumView1();

Row row = vo.first();

and not closing anything.

Is it possible that this is causing a connection leak?

It worked well for many years until recently I am starting to get an issue and I see a lot of inactive sessions with this view object that is executing on every row selection of a specific table...



  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,931 Red Diamond

    The code should not cause a connection leak. vo.first() uses the default rowsetiterator. The other code creates its own default iterator and releases it after the work has been done.

    Have you tried this in the current version do you see the same behavior there?

    You might have found a bug in your version. If you don't see the behavior in the current version, you should file an SR with and ask them for a fix.


  • dvohra21
    dvohra21 Member Posts: 14,692 Gold Crown

    First, find if any connection leak issues exist. Enable Connection Leak Profiling.

    Detail at Diagnosing Connection Leaks in an ADF Application Running in WebLogic (Doc ID 2726546.1)