-->
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: Session.isDirty returns true but not sql gets executed
PostPosted: Fri Jul 07, 2006 5:36 am 
Newbie

Joined: Wed Nov 02, 2005 5:15 am
Posts: 3
Hi, the example code returns true for session.isDirty (as expected) but no sql will be executed.

try {
tx = session.beginTransaction ();

// creating a many-to-many for two persistent entities

System.out.println(session.isDirty ());
tx.commit ();
}
catch (Exception e) {
if (tx != null) {
tx.rollback ();
}
}
finally {
session.close ();
}

Are there any know conditions for that behaviour, or do I misinterpret the api doc?
Hibernate version is 3.1.3


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 10, 2006 12:22 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Have you logged any exceptions? If isDirty returned true but an exception was thrown before any SQL was generated, that would explain what you're seeing.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 11, 2006 10:48 am 
Newbie

Joined: Wed Nov 02, 2005 5:15 am
Posts: 3
Adding an element to a set makes the session dirty even if the element was in the set already.


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.