Hello all.
I am fairly new with Hibernate and running into an issue I can't resolve.
I have a Message Driven Bean which recieves a Hibernate Object. After some manupulations with that object, it is being saved into DB (Informix in my case). Every now and again that creates deadlocks in database, which are very difficult to resolve. I think I understand why this is happenning (fond some similar cases for different database), but don't know how to avod this in my case. Mapping is simple - one class = one table. Code seems to be simple (in onMessage() with CMP)
DafcFill trdObj = (DafcFill) _obj; Session hSession = hbSessionFactory.getCurrentSession();
// Data Manipulation ..... hSession.save(trdObj);
Can someone please help me out with this
Thaks in advance....
Hibernate version: 3.1
Mapping documents:
On JBoss:
<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="pbbo.jboss.hibernate:name=PbboHibernateSessionFactory">
<attribute name="DatasourceName">java:/jdbc/ADPDDB_DEV_XA_DS</attribute>
<attribute name="Dialect">org.hibernate.dialect.InformixDialect</attribute>
<attribute name="SessionFactoryName">java:/Hibernate/PbboHibernateSessionFactory</attribute>
<attribute name="ShowSqlEnabled">false</attribute>
</mbean>
</server>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
2006-02-15 10:18:49,833 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: -258, SQLState: IX000 2006-02-15 10:18:49,833 ERROR [org.hibernate.util.JDBCExceptionReporter] System error - invalid statement id received by the sqlexec process. 2006-02-15 10:18:49,833 ERROR [com.bofa.pb.st.message.dafc_msg.DafcHbProcessor] Error saving object to db org.hibernate.exception.GenericJDBCException: could not insert: [com.bofa.pb.dafc.orm.DafcFill] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1985) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2404) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243) 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:524) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:510) at com.bofa.pb.st.message.dafc_msg.DafcHbProcessor.process(DafcHbProcessor.java:31) at com.bofa.pb.st.message.dafc_msg.DafcFillPrepMDB.onMessage(DafcFillPrepMDB.java:61) at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.invocation.Invocation.performCall(Invocation.java:345) at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149) at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:101) at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166) at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192) at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122) at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389) at org.jboss.ejb.Container.invoke(Container.java:873) at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1077) at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1379) at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256) at com.ibm.mq.jms.MQSession.run(MQSession.java:1136) at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:182) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748) at java.lang.Thread.run(Thread.java:534) Caused by: java.sql.SQLException: System error - invalid statement id received by the sqlexec process. at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373) at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208) at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518) at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353) at com.informix.jdbcx.IfxXASqli.receiveMessage(IfxXASqli.java:120) at com.informix.jdbc.IfxSqli.executeRelease(IfxSqli.java:1905) at com.informix.jdbc.IfxStatement.close(IfxStatement.java:500) at org.jboss.resource.adapter.jdbc.WrappedStatement.internalClose(WrappedStatement.java:550) at org.jboss.resource.adapter.jdbc.WrappedStatement.close(WrappedStatement.java:46) at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:468) at org.hibernate.jdbc.AbstractBatcher.closeStatement(AbstractBatcher.java:216) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1980) ... 39 more Caused by: java.sql.SQLException at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373) at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523) ... 48 more
Name and version of the database you are using:
Informix 9.x
|