-->
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.  [ 4 posts ] 
Author Message
 Post subject: Changes not being saved consistently.
PostPosted: Thu Jul 12, 2007 10:17 pm 
Beginner
Beginner

Joined: Mon Jun 25, 2007 11:57 pm
Posts: 28
Hi,

I'm having a problem persisiting changes to the database.
When i change the value of one property (GIVEN_NAME), then change is persisted to the database. However, when i make a change to another property (FAMILY_NAME), the change is not persisted.

These properties are both columns on the same table and both have been included in the equals() and hashcode() methods.

Call to saveOrUpdate() is done through getHibernateTemplate() in a Spring application and i am using the OpenSessionInViewInterceptor class for session handling.

Why would this happen? How is there any difference between these two columns?

Thanks,
John

Hibernate version: 3.2.4 sp1

Name and version of the database you are using: Oracle 10g


<property name="givenNames" type="string">
<meta attribute="use-in-tostring" inherit="false">true</meta>

<meta attribute="use-in-equals" inherit="false">true</meta>

<column name="GIVEN_NAMES" length="100" />
</property>

<property name="familyName" type="string">
<meta attribute="use-in-tostring" inherit="false">true</meta>

<meta attribute="use-in-equals" inherit="false">true</meta>

<column name="FAMILY_NAME" length="100" />
</property>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 12, 2007 10:21 pm 
Beginner
Beginner

Joined: Mon Jun 25, 2007 11:57 pm
Posts: 28
Another point to note that it will only attempt to save the GIVEN_NAME if i have not made a change to the FAMILY_NAME property. If i edit both of these values on the jsp, then it doesn't try to save the record.

So something is up with my FAMILY_NAME property because when i modify it, record does not get saved..

Anybody..?!

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 6:36 pm 
Beginner
Beginner

Joined: Mon Jun 25, 2007 11:57 pm
Posts: 28
Hi,

Anyone got any ideas on this one?

Thanks,
John


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 6:45 pm 
Beginner
Beginner

Joined: Mon Jun 25, 2007 11:57 pm
Posts: 28
Please ignore above comments.

The problem is actually that when you call save() first time (on either column being changed) then it does not attempt to update the record. It is only when you call save a second time (without any value needing to be changed) that it attempts to update the record.

Anyone got any ideas?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.