Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7600643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:57:39+00:00 2026-05-30T22:57:39+00:00

I am using hibernate to do mapping to database. But encountered the following error:

  • 0

I am using hibernate to do mapping to database.
But encountered the following error:

A exec job config finished.
org.hibernate.exception.JDBCConnectionException: could not insert collection rows: [com.myCompany.jobsrc.ExecJob.subRunningIDs#1]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.persister.collection.AbstractCollectionPersister.insertRows(AbstractCollectionPersister.java:1454)
at org.hibernate.action.CollectionUpdateAction.execute(CollectionUpdateAction.java:86)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:187)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
at com.myCompany.jobsrc.BasicDaoImpl.saveOrUpdate(BasicDaoImpl.java:38)
at com.myCompany.jobBatch.ExecJobRoutine.generateExecJob(ExecJobRoutine.java:100)
at com.com.myCompany.jobBatch.MarkerRoutine.execute(MarkerRoutine.java:33)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.sql.BatchUpdateException: No operations allowed after statement closed.
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1269)
at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:955)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:56)
at org.hibernate.persister.collection.AbstractCollectionPersister.insertRows(AbstractCollectionPersister.java:1427)
... 14 more

My method of saveOrUpdate:

public void saveOrUpdate(T t){
    Session session = HibernateUtil.getSession();
    Transaction transaction = session.beginTransaction();
    session.saveOrUpdate(t);
    transaction.commit();
}

This is my hibernate.cfg.xml:

  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
  <property name="hibernate.connection.password">eboxroot</property>
  <property name="hibernate.connection.url">jdbc:mysql://127.0.0.1:3306  /jobtest?autoReconnect=true</property>
  <property name="hibernate.connection.username">root</property>
 <property name="hibernate.hbm2ddl.auto">update</property>
 <property name="hibernate.cache.use_second_level_cache">false</property>
  <property name="hibernate.cache.use_query_cache">false</property>
 <property name="hibernate.connection.autoReconnect">true</property>
<property    name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> 
 <property name="c3p0.min_size">5</property>
 <property name="c3p0.max_size">30</property>
 <property name="c3p0.time_out">1800</property>
 <!--property name="c3p0.max_statement">50</property-->
<property name="c3p0.acquire_increment">5</property>
<property name="c3p0.idle_test_period">10</property>
<property name="c3p0.preferredTestQuery">select 1;</property>
<property name="c3p0.debugUnreturnedConnectionStackTraces">true</property>
<property name="hibernate.connection.autoReconnectForPools">true</property>
<!--property name="show_sql">true</property  -->

This is not happening all the time, but like sometimes.
Could anyone please give me some hint?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:57:40+00:00Added an answer on May 30, 2026 at 10:57 pm

    Finally get the problem solved. It was because I set c3p0 max_statements to 50. It caches only 50. Now I set it to 0 which means no cache. Now I set it to 0, it works perfect!
    Thanks for the help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Hibernate Mapping, which has to be mapped using the Table
I'm using spring and hibernate to display an extjs chart from database. But, when
I'm trying to call a stored procedure using Hibernate, but I'm getting the following
I'm using Fluent NHibernate auto mapping. I need to access more than one database
I'm using Hibernate's JPA impl to model some tables. I'm having trouble mapping a
I am using Hibernate 3.x, MySQL 4.1.20 with Java 1.6. I am mapping a
I'm considering using Annotations to define my Hibernate mappings but have run into a
I'm hesitating between two designs of a database project using Hibernate. Design #1. (1)
I'm using Hibernate 3.6 but would prefer to stick to JPA annotations if possible.
I am using hibernate 3.6.7 to do mapping. I set the connection part as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.