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: SQL update or deletion failed (row not found)
PostPosted: Wed Nov 05, 2003 2:39 pm 
Pro
Pro

Joined: Mon Sep 08, 2003 4:30 pm
Posts: 203
Hi all,

Scenario:
1. read an object from the DB, keep it in Object1 (has a collection of sites). ok
2. read the same object from the DB, keep it in Object2. ok
3. update Object2 (triggers delete from sites...). ok
4. try to update Object1 (no site deletion), but it calls again delete from sites... and throws the exception.

I don't want to re-read Object1 from the DB after Object2 updates it.
Is there a work around for this?

TIA,
--steve p.


Hibernate: update neowner set name=?, description=? where id=?
Hibernate: update necustomer set mgmt_user_name=?, mgmt_passwd=?, mgmt_access=?, contactInfo=?, locationInfo=? where id=?
Hibernate: update contactinfo set name=?, salutation=?, phone_number=?, mobile_phone=?, pager_number=?, email=? where id=?
Hibernate: update locationinfo set street=?, city=?, country=?, zipcode=? where id=?
Hibernate: update sites set site_name=?, description=?, contactInfo=?, locationInfo=?, own_site_id=?, domain_site_id=? where id=?
Hibernate: delete from sites where id=?
[AWT-EventQueue-0] [2003-11-05 13:22:58,326] INFO - commit
[AWT-EventQueue-0] [2003-11-05 13:22:58,326] INFO - Session closed
[AWT-EventQueue-0] [2003-11-05 13:23:03,216] INFO - Session opened
[AWT-EventQueue-0] [2003-11-05 13:23:03,216] INFO - beginTransaction
Hibernate: update neowner set name=?, description=? where id=?
Hibernate: update necustomer set mgmt_user_name=?, mgmt_passwd=?, mgmt_access=?, contactInfo=?, locationInfo=? where id=?
Hibernate: update contactinfo set name=?, salutation=?, phone_number=?, mobile_phone=?, pager_number=?, email=? where id=?
Hibernate: update locationinfo set street=?, city=?, country=?, zipcode=? where id=?
Hibernate: update sites set site_name=?, description=?, contactInfo=?, locationInfo=?, own_site_id=?, domain_site_id=? where id=?
Hibernate: delete from sites where id=?
[AWT-EventQueue-0] [2003-11-05 13:23:03,232] ERROR - Could not synchronize database state with session
net.sf.hibernate.HibernateException: SQL update or deletion failed (row not found)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:25)
at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:635)
at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:27)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2362)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2321)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2258)
at com.diatem.persistence.HibernateSession.flush(HibernateSession.java:81)
at com.diatem.persistence.PersistentSession.flush(PersistentSession.java:53)
at com.diatem.db.device.DeviceHelper.updateCustomer(DeviceHelper.java:506)
at com.diatem.gui.elements.customermanagement.actions.ModifyCustomerAction.executeDirectly(ModifyCustomerAction.java:235)
at com.diatem.gui.elements.customermanagement.actions.ModifyCustomerAction.execute(ModifyCustomerAction.java:81)
at com.diatem.gui.elements.customermanagement.wizards.CustomerCreationWiz.modifyCustomer(CustomerCreationWiz.java:1094)
at com.diatem.gui.elements.customermanagement.wizards.CustomerCreationWiz.jButtonApply_ActionPerformed(CustomerCreationWiz.java:867)
at com.diatem.gui.elements.customermanagement.wizards.CustomerCreationWiz$1.actionPerformed(CustomerCreationWiz.java:181)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5134)
at java.awt.Component.processEvent(Component.java:4931)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3639)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1590)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
at java.awt.Dialog.show(Dialog.java:551)
at com.diatem.gui.elements.customermanagement.CustomerMgmt.showCustomerCreationWiz(CustomerMgmt.java:1270)
at com.diatem.gui.elements.customermanagement.CustomerMgmtEngine.performAction(CustomerMgmtEngine.java:123)
at com.diatem.gui.elements.customermanagement.actions.ModifyCustomerAction.execute(ModifyCustomerAction.java:86)
at com.diatem.gui.elements.tree.NetPortalTree.insertNode(NetPortalTree.java:417)
at com.diatem.gui.elements.tree.NetPortalTree.dropIcon(NetPortalTree.java:243)
at com.diatem.gui.elements.tree.NetPortalTree.drop(NetPortalTree.java:1075)
at java.awt.dnd.DropTarget.drop(DropTarget.java:404)
at sun.awt.dnd.SunDropTargetContextPeer.processDropMessage(SunDropTargetContextPeer.java:547)
at sun.awt.dnd.SunDropTargetContextPeer.access$800(SunDropTargetContextPeer.java:52)
at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchDropEvent(SunDropTargetContextPeer.java:806)
at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:744)
at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:29)
at java.awt.Component.dispatchEventImpl(Component.java:3497)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:3236)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3090)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1590)
at java.awt.Component.dispatchEvent(Component.java:3480)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)


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.