Forum Stats

  • 3,759,507 Users
  • 2,251,556 Discussions
  • 7,870,689 Comments

Discussions

New ojdbc 7 12.0.1.2 maximum cursor limit exceeded

cplaistow
cplaistow Member Posts: 1

We are running a set of unit tests using the latest ojdbc 7 driver and the highest open cursor keeps going up, until it hits our 300 limit, then throws the cursor limit exception. If we run these tests using ojdbc 12.0.1.1, the highest open cursor stays at 17 and doesn't cause this exception.

The query used to monitor these cursors is below:

SELECT  max(a.value) as highest_open_cur, p.value as max_open_cur FROM v$sesstat a, v$statname b, v$parameter p WHERE  a.statistic# = b.statistic#  and b.name = 'opened cursors current' and p.name= 'open_cursors' group by p.value

Has anyone else had this problem?

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

Java 8 version 31

Answers

  • castorp
    castorp Member Posts: 469 Blue Ribbon
    edited Mar 5, 2015 10:12AM

    Yes we had this issue as well. As far as I can tell (after de-compiling the driver and monitoring V$SQL) this is caused by calling DatabaseMetaData.getTableTypes(). For some reason Oracle runs the following query inside that function:

    select 'TABLE' as table_type from dual union
    select 'VIEW' as table_type from dual union
    select 'SYNONYM' as table_type from dual
    

    but fails to close the used Statement when doing that.

    I don't understand why they are running a query there in the first place.It seems they can't build a ResultSet inside the driver without actually running a query - not very efficient.

    The 12.0.1.1 and 11.2.0.3  do not have this issue.

  • Joe Weinstein-Oracle
    Joe Weinstein-Oracle Member Posts: 516
    edited Mar 5, 2015 10:27AM

    I'll look into this.

  • Joe Weinstein-Oracle
    Joe Weinstein-Oracle Member Posts: 516
    edited Mar 5, 2015 11:33AM

    Hi all. This is a known bug with a fix you can ask support for: 19632480

This discussion has been closed.