-->
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: Problem with Hibernate2.0 to Hibernate3.0 migration
PostPosted: Mon Jan 23, 2006 10:45 am 
Newbie

Joined: Tue Oct 11, 2005 1:48 am
Posts: 4
Hi All,

This is regarding the migration of my application from Hibernate2.0 to Hibernate3.0.

As per the documentation provided on the site, I had made the following changes in my application:
    1. API Changes: I had changed all the entries of net.sf.hibernate.* to org.hibernate.*
    2. DTD Changes: Made the DTD changes to 3.0...


When I am running my application, my data is not being commited to the database. At the same time I could not see any exception being thrown.

Is there anything I am missing... like any particular attribute to be set in the xml files...

Its bit urgent, please help me at the earliest.

Thanks in advance

_________________
Regards
Pratap


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 11:50 am 
Regular
Regular

Joined: Tue Oct 26, 2004 3:54 pm
Posts: 60
Does any SQL show in your console ?

Enable DEBUG level on org.hibernate.SQL if isn't enabled yet.


Have you tried reverting to Hibernate 2, using the same programs ?

I have succesfully converted several Hibernate 2 apps Hibernate 3 and never had a non committing issue.

Giulio


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 24, 2006 3:01 am 
Newbie

Joined: Tue Oct 11, 2005 1:48 am
Posts: 4
Hi Giulio

I got my application working with hibernate 3.0.
With hibernate2.0, transaction.commit() is sufficient to get the database changes to be effected.
With Hibernate3.0, I came to know that "session.flush()" is also necessary before issuing a transaction.commit();

If I am wrong, please correct me.

_________________
Regards
Pratap


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 24, 2006 4:45 am 
Regular
Regular

Joined: Tue Oct 26, 2004 3:54 pm
Posts: 60
Well, I usually use this (here simplified) construct :

Transaction tx = session.beginTransaction();

try {

... do some work
session.saveOrUpdate(object);

tx.commit();
}
catch (Exception ex) {
tx.rollback();
throw ex;
}
finally {
session.close();
}


Maybe you didn't issue a saveOrUpdate() call ?

Giulio


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.