-->
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: Found two representations of same collection:
PostPosted: Mon May 29, 2006 2:07 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
NHibernate version: 1.0.2

Not sure if anyone can answer this one since it's a little obscure, but here goes:

I'm using the ILifecycle interface to implement logical deletion and in that method I'm executing the following query to check whether the current entity (ProcessingModule) is being used in any other ProcessingModuleInstances.

Code:
SELECT
COUNT(i)
FROM
ProcessingModuleInstance i
WHERE
i.ProcessingModule.id = :Id


If there are no matches then the ProcessingModule.Deleted property is set to true and the deletion is Vetoed. If the query returns anything other than 0 I throw my own exception indicating that the ProcessingModule is referenced.

The problem is that I'm getting another exception "Found two representations of same collection:" (with nothing after the colon) when trying to commit.

If the above query is not run in the ILifecycle.OnDelete method then the unexpected exception does not occur - which seems odd since the above query doesn't actually load any collections.

So, why am I seeing this strange exception - any ideas out there?

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 3:58 am 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
Oh, I should point out that the deletion is being done using the session.Delete(hqlQuery) method.

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 4:39 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Looks like a bug to me, can you report it to JIRA with a test case?


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.