-->
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: Update after Select, please help!
PostPosted: Mon Oct 30, 2006 8:02 am 
Beginner
Beginner

Joined: Thu Jul 06, 2006 4:44 am
Posts: 31
Hi.

My problem is that hibernate tries to update object which is previously selected from the db and the object has not changed during the transaction. The point is that the connected user has no update grants ot that table which throws an exception each time hibernate tries to update the persistent object. Is there any way to tell the hibernate not to update the object?

Greetings

Markov

Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 8:21 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Enable logging at DEBUG level and search for "is dirty", you should then see what properties NH considers dirty.

To prevent NH from ever updating an object, use mutable="false" in <class>.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 10, 2006 12:29 pm 
Newbie

Joined: Fri Aug 18, 2006 7:30 am
Posts: 5
I've got the same problem.
I've found the line with the "dirty" information.

What does it mean that NHibernate considers a property of my object "dirty" ?
Thanks


Top
 Profile  
 
 Post subject: dirty meaning
PostPosted: Fri Nov 10, 2006 3:07 pm 
Newbie

Joined: Fri Nov 10, 2006 2:42 pm
Posts: 2
cyrille wrote:
I've got the same problem.
I've found the line with the "dirty" information.
What does it mean that NHibernate considers a property of my object "dirty" ?
Thanks

Dirty means that the state of the object in memory is different then in the database and Hibernate knows about it and intends to fix this on the next batch update.

A new object is immediately dirty since it's id is not set.
A persistent object is dirty if it has been changed.


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.