java - Maximum open cursors exceeded - with hibernate SchemaValidator -
our oracle 11g database contains 298 tables(10 added), (+100 sequences), declared 500 cursors.
when starting our webapplication (tomcat 7.0, jdbc pool), @ sessionfactory initialization when hibernate validates schema uses cursors (cf below).
is there known in order hibernate less greedy oracle cursors ?
please note problem has nothing handling of prepared statements or hibernate entities not work of them @ step.
caused by: org.hibernate.exception.genericjdbcexception: not table metadata: mytable @ org.hibernate.exception.sqlstateconverter.handlednonspecificexception(sqlstateconverter.java:103) @ org.hibernate.exception.sqlstateconverter.convert(sqlstateconverter.java:91) @ org.hibernate.exception.jdbcexceptionhelper.convert(jdbcexceptionhelper.java:43) @ org.hibernate.exception.jdbcexceptionhelper.convert(jdbcexceptionhelper.java:29) @ org.hibernate.tool.hbm2ddl.databasemetadata.gettablemetadata(databasemetadata.java:105) @ org.hibernate.cfg.configuration.validateschema(configuration.java:1080) @ org.hibernate.tool.hbm2ddl.schemavalidator.validate(schemavalidator.java:116) @ org.hibernate.impl.sessionfactoryimpl.<init>(sessionfactoryimpl.java:317) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1300) @ org.hibernate.cfg.annotationconfiguration.buildsessionfactory(annotationconfiguration.java:859) @ org.springframework.orm.hibernate3.localsessionfactorybean.newsessionfactory(localsessionfactorybean.java:863) @ org.springframework.orm.hibernate3.localsessionfactorybean.buildsessionfactory(localsessionfactorybean.java:782) @ org.springframework.orm.hibernate3.abstractsessionfactorybean.afterpropertiesset(abstractsessionfactorybean.java:188) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeinitmethods(abstractautowirecapablebeanfactory.java:1573) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1511) ... 34 more caused by: java.sql.sqlexception: ora-01000: maximum open cursors exceeded @ oracle.jdbc.driver.t4cttioer.processerror(t4cttioer.java:450) @ oracle.jdbc.driver.t4cttioer.processerror(t4cttioer.java:399) @ oracle.jdbc.driver.t4c8oall.processerror(t4c8oall.java:1059) @ oracle.jdbc.driver.t4cttifun.receive(t4cttifun.java:522) @ oracle.jdbc.driver.t4cttifun.dorpc(t4cttifun.java:257) @ oracle.jdbc.driver.t4c8oall.dooall(t4c8oall.java:587) @ oracle.jdbc.driver.t4cpreparedstatement.dooall8(t4cpreparedstatement.java:225) @ oracle.jdbc.driver.t4cpreparedstatement.dooall8(t4cpreparedstatement.java:53) @ oracle.jdbc.driver.t4cpreparedstatement.executefordescribe(t4cpreparedstatement.java:774) @ oracle.jdbc.driver.oraclestatement.executemaybedescribe(oraclestatement.java:925) @ oracle.jdbc.driver.oraclestatement.doexecutewithtimeout(oraclestatement.java:1111) @ oracle.jdbc.driver.oraclepreparedstatement.executeinternal(oraclepreparedstatement.java:4798) @ oracle.jdbc.driver.oraclepreparedstatement.executequery(oraclepreparedstatement.java:4845) @ oracle.jdbc.driver.oraclepreparedstatementwrapper.executequery(oraclepreparedstatementwrapper.java:1501) @ oracle.jdbc.driver.oracledatabasemetadata.getcolumnswithwildcards(oracledatabasemetadata.java:350) @ oracle.jdbc.driver.oracledatabasemetadata.getcolumns(oracledatabasemetadata.java:128) @ org.hibernate.tool.hbm2ddl.tablemetadata.initcolumns(tablemetadata.java:146) @ org.hibernate.tool.hbm2ddl.tablemetadata.<init>(tablemetadata.java:32) @ org.hibernate.tool.hbm2ddl.databasemetadata.gettablemetadata(databasemetadata.java:90) ... 44 more
if driver version 12.1.0.2 known bug:
https://community.oracle.com/thread/3682300
in nutshell: databasemetadata.gettabletypes()
creates statement
never closes it, leaves cursor open.
most hibernate calls gettabletypes()
quite during schema validation , affected bug.
the driver version 12.1.0.1 not affected this, might want downgrade.
this logged under bug #19632480 if have access mos can download patch this.
Comments
Post a Comment