-->
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.  [ 2 posts ] 
Author Message
 Post subject: not lazy many to one problem
PostPosted: Mon Jun 04, 2007 11:15 am 
Newbie

Joined: Mon Jun 04, 2007 10:30 am
Posts: 1
Hi guys,

I'm using NH 1.2 release for a web app where the requirement is to load everything from DB at Application_Start, so even the many-to-one references are not lazy.

You can guess that I work with detached objects since I load all at one time in the application lifecycle; the problem is that I often I lock some object in order to commit changes but the lock goes by cascade and when it reaches the "one" from many-to-one not lazy relation I get a "NHibernate.TransientObjectException : cannot lock an unsaved transient instance: [...]".

session.Lock(something, LockMode.None);

I realise that the "one" exists from another session, but anyway, it should be IsSaved. All works like a charm if I commit in the same session that queried the objects.

Have any ideas?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 05, 2007 3:04 am 
Newbie

Joined: Tue Mar 13, 2007 10:52 am
Posts: 3
I also have thsi problem! I am stuck trying to find a solution! Does any of you guys know a solution or a workaroud?


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