-->
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.  [ 3 posts ] 
Author Message
 Post subject: Auto commit
PostPosted: Mon May 10, 2010 7:08 am 
Newbie

Joined: Thu Apr 16, 2009 9:25 am
Posts: 5
Hello guys,


I have below method which fetches data base on record Id, and if found set a new name to update the record.
My problem is, when i set the new name, it doesn't show on the record. Meaning the update doesn't persist. Do anyone know what I am doing wrong?

Code:
@Transactional(propagation = Propagation.REQUIRED)
   private void run() throws Exception {
      try{
         Person object= (Person) getById(139);
         object.setName("Testing 123");      
         System.out.println("Name: "+ object.getName());

      } catch (Exception e) {
         e.printStackTrace();
      }
   }


Top
 Profile  
 
 Post subject: Re: Auto commit
PostPosted: Wed May 12, 2010 3:38 am 
Newbie

Joined: Thu Apr 16, 2009 9:25 am
Posts: 5
Hmm! do someone knows what could be wrong here? Hibernate + Spring dirty check.


Top
 Profile  
 
 Post subject: Re: Auto commit
PostPosted: Wed May 12, 2010 11:10 am 
Regular
Regular

Joined: Tue May 11, 2010 5:50 pm
Posts: 54
Location: Norman, Ok, U.S.A
I don't see you persisting the updated object. You still have to update the object. getHibernateTemplate().update(object)


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