-->
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.  [ 1 post ] 
Author Message
 Post subject: Exception while saving a row into database.
PostPosted: Thu Jul 10, 2014 11:30 am 
Newbie

Joined: Mon Mar 03, 2014 5:33 pm
Posts: 4
Hello All

I am trying to insert a record into an oracle table(LOG_INFOS) and subsequently trying to update another record in another oracle table (MESSAGES). But sometimes(I assume its high volume) the hibernate code throws the below exception and the root cause bieng : Caused by: java.sql.BatchUpdateException: ORA-02049: timeout: distributed transaction waiting for lock.

A single EJB method calls 2 separate hibernate DAO classes: one for inserting into LOG_INFOS table and second for updating into MESSAGES table.

Based on the below Exception stack trace

at ups.scs.elf.dao.ElfDAOUtils.saveUMSMessage(ElfDAOUtils.java:844) points to = session.flush(); in the code.



Exception stack trace:
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
at ups.scs.elf.dao.ElfDAOUtils.saveUMSMessage(ElfDAOUtils.java:844)
at ups.scs.elf.dao.ElfDAOUtils.saveUMSMessage(ElfDAOUtils.java:423)
at ups.scs.sip.mdbhandlers.DatabaseTrackerHandler.handleMWMessage(DatabaseTrackerHandler.java:135)
at ups.scs.sip.mdbhandlers.BaseMWMessageHandler.handleMessage(BaseMWMessageHandler.java:423)
at ups.scs.sip.mdbhandlers.BaseMWMessageHandler.handleMessage(BaseMWMessageHandler.java:357)
at ups.scs.common.ejb.mdb.GenericUMSMDB.onMessage(GenericUMSMDB.java:892)
at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:585)
at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:488)
at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:385)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3821)
at weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5170)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: java.sql.BatchUpdateException: ORA-02049: timeout: distributed transaction waiting for lock

at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9040)
at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:205)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 22 more



Thanks


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

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.