-->
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: Problem with updating persistent object
PostPosted: Wed Jan 09, 2008 3:04 pm 
Newbie

Joined: Thu Dec 27, 2007 5:14 pm
Posts: 2
I use Spring and load objects with HibernateTemplates:

getHibernateTemplate().findByNamedQueryAndNamedParam(queryName,
paramNames, paramValues);


Then I change property in one of loaded objects.

To save this change I use:

getSession().flush();
getSession().connection().commit();

but there is no changes in the database.

Is anyone know how to update persistent object ?


Top
 Profile  
 
 Post subject: Re: Problem with updating persistent object
PostPosted: Wed Jan 09, 2008 5:43 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
slawekr wrote:
but there is no changes in the database.

Is anyone know how to update persistent object ?



You won't need to do any flush or commit if you are in scope of a transaction. Loading entities and modifying their values is good enough. In this case you will most likely need to check if transaction settings are fine.


Farzad-


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.