-->
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.  [ 2 posts ] 
Author Message
 Post subject: update column with same value to fire trigger in Db failing
PostPosted: Fri Aug 18, 2006 5:23 am 
Newbie

Joined: Mon Feb 13, 2006 6:42 am
Posts: 5
Hi - We're using Hibernate 2 with Spring for a J2EE app using Weblogic server 8.
I'm trying to update a column on a table with the same value so that a trigger in the database will fire - this works fine when updating the value via the database.
I am calling getHibernateTemplate().update(myObject) from a DAO but the code doesn't seem to fire an update, it appears to do a select and seeing nothing has changed not do the update. It looks like the select-before-update, but this value is not set in the mapping, and should default to false?

<hibernate-mapping>
<class name="common.myObject.MyObject"
table="MY_TABLE"
dynamic-update="false"
dynamic-insert="false">

<id name="id"
column="MY_TABLE_ID"
type="java.lang.Long"
access="field">
<generator class="sequence">
<param name="sequence">MY_TABLE_ID_SEQ</param>
</generator>
</id>

<version name="modificationId"
access="field"
type="long"
column="MODIFICATION_ID"
unsaved-value="null" />
<property name="name"
access="field"
type="java.lang.String"
column="MY_TABLE_NAME" />

Am I missing something in the config to force the update to fire?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 7:15 am 
Newbie

Joined: Mon Feb 13, 2006 6:42 am
Posts: 5
Solved - I had to evict the object from the session, which means that it became transient, hence the update is performed as it uses the select-before-update property (default false)


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

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.