2015-01-24 10:54:00,047 236950 [Thread-1] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.LockAcquisitionException: could not update: [com.wdpr.ldp.integration.entity.DriverValueOutputEntity#component[scenarioId,driverId,businessDate]{scenarioId=2, businessDate=2015-05-13 00:00:00, driverId=1937506}] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:87) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2430) at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312) at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612) at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at com.wdpr.ldp.integration.impl.DriverBatchDaoImp.saveDriverValue(DriverBatchDaoImp.java:166) at com.wdpr.ldp.node.manager.rule.DriverBatchManager.saveDriverValue(DriverBatchManager.java:38) at com.wdpr.ldp.ddr.manager.DdrExecutionManager.processDdr(DdrExecutionManager.java:117) at com.wdpr.ldp.ddr.manager.DdrExecutionThreadLauncher.run(DdrExecutionThreadLauncher.java:32) at java.lang.Thread.run(Thread.java:662) Caused by: java.sql.BatchUpdateException: ORA-00060: deadlock detected while waiting for resource --can you please any body help me
public void saveDriverValue(final Set<DdrRuleOutput> ddrRuleOutputs) { final long beginTime = System.currentTimeMillis(); DriverBatchDaoImp.LOG.trace("Inside saveDriverValue()");
int dbCount = 0;
Session session = null; Transaction trans = null;
try { session = getSessionFactory().openSession(); trans = session.beginTransaction();
final int dataSourceId = getDataSourceId("Derived Driver"); for (final DdrRuleOutput ruleOutput : ddrRuleOutputs) { final DriverValueOutputEntity driverValueEntity = this.driverValueHelper.driverValueModelToEntity(ruleOutput, dataSourceId); session.saveOrUpdate(driverValueEntity);
dbCount++; if (dbCount % this.batchSize == 0) { session.flush(); session.clear(); } }
session.flush(); session.clear(); }
|