Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.0.5
Database version: Oracle 9.2i
The generated SQL (show_sql=true):
select MoOid.nextval from dual
select MoOid.nextval from dual
select MoOid.nextval from dual
select MoOid.nextval from dual
select MoOid.nextval from dual
select MoOid.nextval from dual
Debug level Hibernate log excerpt:
1845503 2005-08-11 19:06:13,386: [pool-1-thread-4] DEBUG org.hibernate.SQL:324 - select MoOid.nextval from dual
1845503 2005-08-11 19:06:13,386: [pool-1-thread-4] DEBUG org.hibernate.jdbc.AbstractBatcher:378 - preparing statement
1845503 2005-08-11 19:06:13,386: [pool-1-thread-4] DEBUG org.hibernate.jdbc.AbstractBatcher:298 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
1845503 2005-08-11 19:06:13,386: [pool-1-thread-4] DEBUG org.hibernate.jdbc.AbstractBatcher:416 - closing statement
1845519 2005-08-11 19:06:13,402: [pool-1-thread-4] DEBUG org.hibernate.jdbc.AbstractBatcher:290 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
1845519 2005-08-11 19:06:13,402: [pool-1-thread-4] DEBUG org.hibernate.SQL:324 - select MoOid.nextval from dual
1845519 2005-08-11 19:06:13,402: [pool-1-thread-4] DEBUG org.hibernate.jdbc.AbstractBatcher:378 - preparing statement
1845519 2005-08-11 19:06:13,402: [pool-1-thread-4] DEBUG org.hibernate.jdbc.AbstractBatcher:298 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
1845535 2005-08-11 19:06:13,418: [pool-1-thread-4] DEBUG org.hibernate.jdbc.AbstractBatcher:416 - closing statement
etc... (repeated 10,000 times)
Hello!
I am trying to speed up an application inserting several millions of records. Is there a way to prevent Hibernate from closing PreparedStatement for getting the next value of sequence? This statement is executed in the loop, and it would be really nice if Hibernate can chache it...
Thank you,
Dmitri