-->
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: Cannot delete a row
PostPosted: Tue Apr 05, 2005 11:32 am 
Newbie

Joined: Tue Apr 05, 2005 11:20 am
Posts: 1
Hello,

I am trying to delete a row, and I get the exception as shown below. I have posted all details below.

Thank you
HibernateUser2005

Hibernate-2.1

-----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping
>
<class
name="com.breakthroughfutures.security.model.Application"
table="application"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>

<id
name="applicationPkey"
column="app_pkey"
type="java.lang.Long"
>
<generator class="sequence">
<param name="sequence">app_pkey_seq</param>
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Application.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>

<timestamp
name="updateDttm"
column="upd_dttm"
/>

<property
name="applicationId"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="app_id"
length="12"
not-null="true"
/>

<property
name="applicationName"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="app_name"
length="30"
not-null="true"
/>

<property
name="description"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="app_desc"
length="50"
not-null="true"
/>

<property
name="createDttm"
type="java.sql.Timestamp"
update="true"
insert="true"
access="property"
column="cre_dttm"
not-null="true"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Application.xml
containing the additional properties and place it in your merge dir.
-->

</class>

</hibernate-mapping>

-----------------------------------------

Hibernate: delete from application where app_pkey=? and upd_dttm=?
08:03:04,219 WARN StaleObjectStateException:27 - An operation failed due to stale data
net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for com.breakthroughfutures.security.model.Application instance with identifier: 1
at net.sf.hibernate.persister.AbstractEntityPersister.check(AbstractEntityPersister.java:514)
at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:580)
at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2438)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2396)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2260)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at com.breakthroughfutures.security.model.Application.delete(Application.java:243)
at com.breakthroughfutures.security.ui.handlers.ApplicationMaintenanceHandler.deleteApplication(ApplicationMaintenanceHandler.java:287)
at com.breakthroughfutures.security.ui.handlers.ApplicationMaintenanceHandler.actionPerformed(ApplicationMaintenanceHandler.java:180)
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:5093)
at java.awt.Component.processEvent(Component.java:4890)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3598)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3439)
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:1585)
at java.awt.Component.dispatchEvent(Component.java:3439)
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)
08:03:04,219 ERROR SessionImpl:2399 - Could not synchronize database state with session

-----------------------------------------

postgreSQL 8.0

-----------------------------------------

Hibernate: delete from application where app_pkey=? and upd_dttm=?

-----------------------------------------


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.