-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Random could not insert error
PostPosted: Fri May 15, 2009 4:43 am 
Newbie

Joined: Fri May 15, 2009 4:16 am
Posts: 2
Hello,
I've got a curious problem.
I'm using Hibernate-Version: 3.1.3 with mysql 5 and the driver connection org.gjt.mm.mysql.Driver

I've got a web application that works fine, the forms are posted correctly, objects inserted in the database but sometimes like once a month I've got this error :

Code:
1205 : could not insert [miju.game.business.bean.Furniture]
org.hibernate.exception.GenericJDBCException : could not insert: [miju.game.business.bean.Furniture] at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1986) at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405) at
org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37) at
org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248) at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java :269) at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167) at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101) at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186) at
org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java : 175) at
org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at
org.hibernate.impl.SessionImpl.fireSave(SessionImpl:530) at
org.hibernate.impl.SessionImpl.save(SessionImpl.java:518) at
org.hibernate.impl.SessionImpl.save(SessionImpl.java:514) at


If I refresh the page so I get back on the web page, enter exactly the same informations, the insertion work just fine.

I suspect a connection problem, hibernate might lose the connection for some reason but I really don't know.

Here are my configuration file

Code:
hibernate.dialect org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class org.gjt.mm.mysql.Driver
hibernate.connection.url jdbc:mysql://10.170.1.210:3306/datas

hibernate.dbcp.maxActive 10
hibernate.dbcp.whenExhaustedAction 1
hibernate.dbcp.maxWait 20000
hibernate.dbcp.maxIdle 5
hibernate.transaction.auto_close_session=false

hibernate.dbcp.validationQuery select 1 from dual
hibernate.dbcp.testOnBorrow true
hibernate.dbcp.testOnReturn true

hibernate.show_sql true

hibernate.connection.isolation 2

hibernate.jdbc.batch_size 0

hibernate.jdbc.batch_versioned_data true

hibernate.jdbc.use_streams_for_binary true

hibernate.max_fetch_depth 1

hibernate.cglib.use_reflection_optimizer false

hibernate.cache.use_second_level_cache false


The connection timeout is set to 28800 seconds on mysql

So if you have got any ideas on how could I produce this system crash so I can correct it or even better if you have the answer that would be great.

If you need more informations tell me I'll post it.

Thank you in advance !


Top
 Profile  
 
 Post subject: Re: Random could not insert error
PostPosted: Mon May 25, 2009 11:04 am 
Newbie

Joined: Fri May 15, 2009 4:16 am
Posts: 2
The error happened on my computer this time so I got the complete error

Here the complete log of the error :
Code:
org.hibernate.exception.GenericJDBCException: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1986) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514) at miju.game.persistence.dao.priseEnCharge.mesure.MesureDao.save(MesureDao.java:599) at miju.game.business.service.priseEnCharge.mesure.MesureService.enregistrer(MesureService.java:158) at miju.game.presentation.action.priseEnCharge.mesure.MesurePlacementAction.enregistrerMesurePlacement(MesurePlacementAction.java:224) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276) at com.teamlog.fwk.web.struts.TlgBaseAction.execute(TlgBaseAction.java:63) at miju.game.core.struts.presentation.action.GameAction.execute(GameAction.java:88) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.teamlog.fwk.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:105) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534) Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1169) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:693) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1404) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1318) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1303) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1968) ... 47 more rethrown as com.teamlog.fwk.persistence.dao.exception.DataAccessException: 1205: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at miju.game.persistence.dao.priseEnCharge.mesure.MesureDao.save(MesureDao.java:607) at miju.game.business.service.priseEnCharge.mesure.MesureService.enregistrer(MesureService.java:158) at miju.game.presentation.action.priseEnCharge.mesure.MesurePlacementAction.enregistrerMesurePlacement(MesurePlacementAction.java:224) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276) at com.teamlog.fwk.web.struts.TlgBaseAction.execute(TlgBaseAction.java:63) at miju.game.core.struts.presentation.action.GameAction.execute(GameAction.java:88) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.teamlog.fwk.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:105) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534) Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1986) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514) at miju.game.persistence.dao.priseEnCharge.mesure.MesureDao.save(MesureDao.java:599) ... 32 more Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1169) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:693) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1404) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1318) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1303) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1968) ... 47 more rethrown as com.teamlog.fwk.exception.TechnicalException: Enregistrement d'une mesure: 1205: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at miju.game.business.service.priseEnCharge.mesure.MesureService.enregistrer(MesureService.java:168) at miju.game.presentation.action.priseEnCharge.mesure.MesurePlacementAction.enregistrerMesurePlacement(MesurePlacementAction.java:224) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276) at com.teamlog.fwk.web.struts.TlgBaseAction.execute(TlgBaseAction.java:63) at miju.game.core.struts.presentation.action.GameAction.execute(GameAction.java:88) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.teamlog.fwk.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:105) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534) Caused by: com.teamlog.fwk.persistence.dao.exception.DataAccessException: 1205: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at miju.game.persistence.dao.priseEnCharge.mesure.MesureDao.save(MesureDao.java:607) at miju.game.business.service.priseEnCharge.mesure.MesureService.enregistrer(MesureService.java:158) ... 31 more Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1986) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514) at miju.game.persistence.dao.priseEnCharge.mesure.MesureDao.save(MesureDao.java:599) ... 32 more Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1169) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:693) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1404) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1318) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1303) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1968) ... 47 more rethrown as com.teamlog.fwk.exception.SystemException: : Enregistrement d'une mesure: 1205: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at miju.game.core.struts.presentation.action.GameAction.execute(GameAction.java:99) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.teamlog.fwk.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:105) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534) Caused by: com.teamlog.fwk.exception.TechnicalException: Enregistrement d'une mesure: 1205: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at miju.game.business.service.priseEnCharge.mesure.MesureService.enregistrer(MesureService.java:168) at miju.game.presentation.action.priseEnCharge.mesure.MesurePlacementAction.enregistrerMesurePlacement(MesurePlacementAction.java:224) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276) at com.teamlog.fwk.web.struts.TlgBaseAction.execute(TlgBaseAction.java:63) at miju.game.core.struts.presentation.action.GameAction.execute(GameAction.java:88) ... 23 more Caused by: com.teamlog.fwk.persistence.dao.exception.DataAccessException: 1205: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at miju.game.persistence.dao.priseEnCharge.mesure.MesureDao.save(MesureDao.java:607) at miju.game.business.service.priseEnCharge.mesure.MesureService.enregistrer(MesureService.java:158) ... 31 more Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [miju.game.business.bean.priseEnCharge.mesure.MesurePlacement] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1986) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514) at miju.game.persistence.dao.priseEnCharge.mesure.MesureDao.save(MesureDao.java:599) ... 32 more Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1169) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:693) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1404) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1318) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1303) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1968) ... 47 more


Top
 Profile  
 
 Post subject: Re: Random could not insert error
PostPosted: Tue May 26, 2009 7:20 am 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
Almost at the end (the last 'caused by') you have the real culprint:

java.sql.SQLException: Lock wait timeout exceeded

I'm no MySQL expert, but this sounds like one of the following problems:

- Deadlock (needs fixing once it's identified)
- Somebody holding a lock for too long (changing the timeout time MIGHT help with this)
- The database gets hogged down so badly, that it can't handle requests in a timely manner (I probably would have noticed that)

Check if MySQL logs more details about failures due to locks.

kind regards
Jens

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


Top
 Profile  
 
 Post subject: Re: Random could not insert error
PostPosted: Tue Jun 30, 2009 2:24 pm 
Newbie

Joined: Tue Jun 30, 2009 2:16 pm
Posts: 1
Hi
Even we are facing the same issue.

Problem is that this error occurs randomly.

Once I restart my MySQL server and Tomcat(Liferay), it works and the suddenly I get Transaction timedout.

If it would have been a deadlock problem, I expect the problem to come every time. But surprised that hibernate is saving the same data some times.

Most of the queries being created are simple inserts and updates and should not take more than a second or two to execute.

I am unable to identify the exact problem as there is no info provided by Hibernate, server console, or MySQl logs.

Any help would be appreciated.

Thanks


Top
 Profile  
 
 Post subject: Re: Random could not insert error
PostPosted: Tue Jun 30, 2009 2:33 pm 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
get yourself the mysql documentation and find out which session is holding a lock and why. This can be hard, but it really isn't a hibernate problem

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.