From: Andreas D. (JIRA) <no...@at...> - 2006-05-15 11:47:16
|
Exception ORA-01000 too many open cursors by generated="insert" --------------------------------------------------------------- Key: HHH-1750 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750 Project: Hibernate3 Type: Bug Environment: Hibernate3, Oracle10g Reporter: Andreas Dornhof When creating more as 300 Object in Oracle with insert="false" and generated="insert" by property - Tag in Mapping-File causes an ORA-01000 "too many open cursors"... It is executed using the following Java code: SessionFactory sessionFactory; try { // Create the SessionFactory from hibernate.cfg.xml sessionFactory = new Configuration(). configure(). buildSessionFactory(); } catch (Throwable ex) { // Make sure you log the exception, as it might be swallowed System.err.println("Initial SessionFactory creation failed." + ex); throw new ExceptionInInitializerError(ex); } try{ for (int i = 0; i <= 301; i++) { Session session = sessionFactory.getCurrentSession(); Transaction tx = session.beginTransaction(); Test test = new Test(); session.save(test); tx.commit(); } } catch (Exception e) { System.out.println(e.getMessage()+e.getClass().toString()); } And Mapping - File: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > <hibernate-mapping> <class name="src.persistence.Test" table="TEST" > <id name="id" type="java.lang.Long" column="ID" > <generator class="sequence"> <param name="sequence">TEST_SEQ</param> </generator> </id> <property name="created" column="CREATED" type="java.util.Date" not-null="true" insert="false" update="false" generated="insert" > </property> </class> </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Benoit Goudreault-E. (JIRA) <no...@at...> - 2006-05-17 19:16:13
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750?page=all ] Benoit Goudreault-Emond updated HHH-1750: ----------------------------------------- Attachment: HHH-1750.patch I've tracked down the problem to AbstractEntityPersister's processGeneratedProperties() method. The ResultSet and PreparedStatement were being leaked. The attached patch is applicable against 3.1.3. It works for me. > Exception ORA-01000 too many open cursors by generated="insert" > --------------------------------------------------------------- > > Key: HHH-1750 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750 > Project: Hibernate3 > Type: Bug > Environment: Hibernate3, Oracle10g > Reporter: Andreas Dornhof > Attachments: HHH-1750.patch > > > When creating more as 300 Object in Oracle with insert="false" and generated="insert" by property - Tag in Mapping-File > causes an ORA-01000 "too many open cursors"... > It is executed using the following Java code: > SessionFactory sessionFactory; > > try { > // Create the SessionFactory from hibernate.cfg.xml > sessionFactory = new Configuration(). > configure(). > buildSessionFactory(); > } catch (Throwable ex) { > // Make sure you log the exception, as it might be swallowed > System.err.println("Initial SessionFactory creation failed." + ex); > throw new ExceptionInInitializerError(ex); > } > > try{ > > for (int i = 0; i <= 301; i++) { > > Session session = sessionFactory.getCurrentSession(); > Transaction tx = session.beginTransaction(); > > Test test = new Test(); > session.save(test); > > tx.commit(); > > } > > } catch (Exception e) { > System.out.println(e.getMessage()+e.getClass().toString()); > } > > And Mapping - File: > <?xml version="1.0"?> > <!DOCTYPE hibernate-mapping PUBLIC > "-//Hibernate/Hibernate Mapping DTD//EN" > "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > > <hibernate-mapping> > <class > name="src.persistence.Test" > table="TEST" > > > > <id name="id" type="java.lang.Long" column="ID" > > > <generator class="sequence"> > <param name="sequence">TEST_SEQ</param> > </generator> > </id> > <property > name="created" > column="CREATED" > type="java.util.Date" > not-null="true" > insert="false" > update="false" > generated="insert" > > > </property> > </class> > </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Benoit Goudreault-E. (JIRA) <no...@at...> - 2006-07-04 13:47:57
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750?page=comments#action_23531 ] Benoit Goudreault-Emond commented on HHH-1750: ---------------------------------------------- I've inspected the code in 3.2, and the bug is still there (unclosed PreparedStatement & ResultSet). Would it be possible to apply the patch prior to the 3.2 release? It's a very simple patch, and I believe it's obvious that the ResultSet and PreparedStatement ought to be closed. Especially since it's done in every other method in AbstractEntityPersister. Leaving PreparedStatements unclosed is extremely bad when using Oracle--it will exhaust cursors very quickly. I'd hate to have to recompile a custom hibernate version every time a new release comes out... > Exception ORA-01000 too many open cursors by generated="insert" > --------------------------------------------------------------- > > Key: HHH-1750 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750 > Project: Hibernate3 > Type: Bug > Environment: Hibernate3, Oracle10g > Reporter: Andreas Dornhof > Attachments: HHH-1750.patch > > > When creating more as 300 Object in Oracle with insert="false" and generated="insert" by property - Tag in Mapping-File > causes an ORA-01000 "too many open cursors"... > It is executed using the following Java code: > SessionFactory sessionFactory; > > try { > // Create the SessionFactory from hibernate.cfg.xml > sessionFactory = new Configuration(). > configure(). > buildSessionFactory(); > } catch (Throwable ex) { > // Make sure you log the exception, as it might be swallowed > System.err.println("Initial SessionFactory creation failed." + ex); > throw new ExceptionInInitializerError(ex); > } > > try{ > > for (int i = 0; i <= 301; i++) { > > Session session = sessionFactory.getCurrentSession(); > Transaction tx = session.beginTransaction(); > > Test test = new Test(); > session.save(test); > > tx.commit(); > > } > > } catch (Exception e) { > System.out.println(e.getMessage()+e.getClass().toString()); > } > > And Mapping - File: > <?xml version="1.0"?> > <!DOCTYPE hibernate-mapping PUBLIC > "-//Hibernate/Hibernate Mapping DTD//EN" > "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > > <hibernate-mapping> > <class > name="src.persistence.Test" > table="TEST" > > > > <id name="id" type="java.lang.Long" column="ID" > > > <generator class="sequence"> > <param name="sequence">TEST_SEQ</param> > </generator> > </id> > <property > name="created" > column="CREATED" > type="java.util.Date" > not-null="true" > insert="false" > update="false" > generated="insert" > > > </property> > </class> > </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Scott M. (JIRA) <no...@at...> - 2006-08-01 19:47:15
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750?page=all ] Scott Marlow reassigned HHH-1750: --------------------------------- Assign To: Scott Marlow > Exception ORA-01000 too many open cursors by generated="insert" > --------------------------------------------------------------- > > Key: HHH-1750 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750 > Project: Hibernate3 > Type: Bug > Environment: Hibernate3, Oracle10g > Reporter: Andreas Dornhof > Assignee: Scott Marlow > Attachments: HHH-1750.patch > > > When creating more as 300 Object in Oracle with insert="false" and generated="insert" by property - Tag in Mapping-File > causes an ORA-01000 "too many open cursors"... > It is executed using the following Java code: > SessionFactory sessionFactory; > > try { > // Create the SessionFactory from hibernate.cfg.xml > sessionFactory = new Configuration(). > configure(). > buildSessionFactory(); > } catch (Throwable ex) { > // Make sure you log the exception, as it might be swallowed > System.err.println("Initial SessionFactory creation failed." + ex); > throw new ExceptionInInitializerError(ex); > } > > try{ > > for (int i = 0; i <= 301; i++) { > > Session session = sessionFactory.getCurrentSession(); > Transaction tx = session.beginTransaction(); > > Test test = new Test(); > session.save(test); > > tx.commit(); > > } > > } catch (Exception e) { > System.out.println(e.getMessage()+e.getClass().toString()); > } > > And Mapping - File: > <?xml version="1.0"?> > <!DOCTYPE hibernate-mapping PUBLIC > "-//Hibernate/Hibernate Mapping DTD//EN" > "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > > <hibernate-mapping> > <class > name="src.persistence.Test" > table="TEST" > > > > <id name="id" type="java.lang.Long" column="ID" > > > <generator class="sequence"> > <param name="sequence">TEST_SEQ</param> > </generator> > </id> > <property > name="created" > column="CREATED" > type="java.util.Date" > not-null="true" > insert="false" > update="false" > generated="insert" > > > </property> > </class> > </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Scott M. (JIRA) <no...@at...> - 2006-08-01 19:49:18
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750?page=all ] Scott Marlow updated HHH-1750: ------------------------------ Fix Version: 3.2.0.ga > Exception ORA-01000 too many open cursors by generated="insert" > --------------------------------------------------------------- > > Key: HHH-1750 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750 > Project: Hibernate3 > Type: Bug > Environment: Hibernate3, Oracle10g > Reporter: Andreas Dornhof > Assignee: Scott Marlow > Fix For: 3.2.0.ga > Attachments: HHH-1750.patch > > > When creating more as 300 Object in Oracle with insert="false" and generated="insert" by property - Tag in Mapping-File > causes an ORA-01000 "too many open cursors"... > It is executed using the following Java code: > SessionFactory sessionFactory; > > try { > // Create the SessionFactory from hibernate.cfg.xml > sessionFactory = new Configuration(). > configure(). > buildSessionFactory(); > } catch (Throwable ex) { > // Make sure you log the exception, as it might be swallowed > System.err.println("Initial SessionFactory creation failed." + ex); > throw new ExceptionInInitializerError(ex); > } > > try{ > > for (int i = 0; i <= 301; i++) { > > Session session = sessionFactory.getCurrentSession(); > Transaction tx = session.beginTransaction(); > > Test test = new Test(); > session.save(test); > > tx.commit(); > > } > > } catch (Exception e) { > System.out.println(e.getMessage()+e.getClass().toString()); > } > > And Mapping - File: > <?xml version="1.0"?> > <!DOCTYPE hibernate-mapping PUBLIC > "-//Hibernate/Hibernate Mapping DTD//EN" > "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > > <hibernate-mapping> > <class > name="src.persistence.Test" > table="TEST" > > > > <id name="id" type="java.lang.Long" column="ID" > > > <generator class="sequence"> > <param name="sequence">TEST_SEQ</param> > </generator> > </id> > <property > name="created" > column="CREATED" > type="java.util.Date" > not-null="true" > insert="false" > update="false" > generated="insert" > > > </property> > </class> > </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Scott M. (JIRA) <no...@at...> - 2006-08-02 01:02:13
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750?page=comments#action_23814 ] Scott Marlow commented on HHH-1750: ----------------------------------- I Installed an Oracle 10G express server and was able to recreate the problem and verify that the patch does fix the issue. I want to check a few more things but will check the fix in soon. Yes, I should be able to apply the patch before the 3.2 release. > Exception ORA-01000 too many open cursors by generated="insert" > --------------------------------------------------------------- > > Key: HHH-1750 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750 > Project: Hibernate3 > Type: Bug > Environment: Hibernate3, Oracle10g > Reporter: Andreas Dornhof > Assignee: Scott Marlow > Fix For: 3.2.0.ga > Attachments: HHH-1750.patch > > > When creating more as 300 Object in Oracle with insert="false" and generated="insert" by property - Tag in Mapping-File > causes an ORA-01000 "too many open cursors"... > It is executed using the following Java code: > SessionFactory sessionFactory; > > try { > // Create the SessionFactory from hibernate.cfg.xml > sessionFactory = new Configuration(). > configure(). > buildSessionFactory(); > } catch (Throwable ex) { > // Make sure you log the exception, as it might be swallowed > System.err.println("Initial SessionFactory creation failed." + ex); > throw new ExceptionInInitializerError(ex); > } > > try{ > > for (int i = 0; i <= 301; i++) { > > Session session = sessionFactory.getCurrentSession(); > Transaction tx = session.beginTransaction(); > > Test test = new Test(); > session.save(test); > > tx.commit(); > > } > > } catch (Exception e) { > System.out.println(e.getMessage()+e.getClass().toString()); > } > > And Mapping - File: > <?xml version="1.0"?> > <!DOCTYPE hibernate-mapping PUBLIC > "-//Hibernate/Hibernate Mapping DTD//EN" > "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > > <hibernate-mapping> > <class > name="src.persistence.Test" > table="TEST" > > > > <id name="id" type="java.lang.Long" column="ID" > > > <generator class="sequence"> > <param name="sequence">TEST_SEQ</param> > </generator> > </id> > <property > name="created" > column="CREATED" > type="java.util.Date" > not-null="true" > insert="false" > update="false" > generated="insert" > > > </property> > </class> > </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Scott M. (JIRA) <no...@at...> - 2006-08-02 02:09:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750?page=all ] Scott Marlow resolved HHH-1750: ------------------------------- Resolution: Fixed The patch looks good, nice job! I applied it to the 3.2 branch and head. > Exception ORA-01000 too many open cursors by generated="insert" > --------------------------------------------------------------- > > Key: HHH-1750 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1750 > Project: Hibernate3 > Type: Bug > Environment: Hibernate3, Oracle10g > Reporter: Andreas Dornhof > Assignee: Scott Marlow > Fix For: 3.2.0.ga > Attachments: HHH-1750.patch > > > When creating more as 300 Object in Oracle with insert="false" and generated="insert" by property - Tag in Mapping-File > causes an ORA-01000 "too many open cursors"... > It is executed using the following Java code: > SessionFactory sessionFactory; > > try { > // Create the SessionFactory from hibernate.cfg.xml > sessionFactory = new Configuration(). > configure(). > buildSessionFactory(); > } catch (Throwable ex) { > // Make sure you log the exception, as it might be swallowed > System.err.println("Initial SessionFactory creation failed." + ex); > throw new ExceptionInInitializerError(ex); > } > > try{ > > for (int i = 0; i <= 301; i++) { > > Session session = sessionFactory.getCurrentSession(); > Transaction tx = session.beginTransaction(); > > Test test = new Test(); > session.save(test); > > tx.commit(); > > } > > } catch (Exception e) { > System.out.println(e.getMessage()+e.getClass().toString()); > } > > And Mapping - File: > <?xml version="1.0"?> > <!DOCTYPE hibernate-mapping PUBLIC > "-//Hibernate/Hibernate Mapping DTD//EN" > "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" > > <hibernate-mapping> > <class > name="src.persistence.Test" > table="TEST" > > > > <id name="id" type="java.lang.Long" column="ID" > > > <generator class="sequence"> > <param name="sequence">TEST_SEQ</param> > </generator> > </id> > <property > name="created" > column="CREATED" > type="java.util.Date" > not-null="true" > insert="false" > update="false" > generated="insert" > > > </property> > </class> > </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |