-->
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: Hibernate persistence
PostPosted: Thu May 06, 2010 9:23 am 
Newbie

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

I have a method within my GenericDao which does Save or Update as shown below:
Code:
   public D Upsert(D entity) throws Exception {
      getCurrentSession().saveOrUpdate(entity);
      return entity;
   }

In my Object Dao class I do something like this;

Code:
@Transactional(propagation = Propagation.REQUIRED)
public void doSave(String age, String tel, String book_type) throws Exception{
Person person = new Person(age, tel, book_type);
Upsert(person);
//Confirm the Record ID
System.out.println(person.getId());
}

If execute the doSave method a new Person object is created and Id printed to console.

Problem:
My problem is when I inspect the physical table's to fetch this record, it doesn't exist, or any physical commit made. Do anyone knows what's going on here?


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.