-->
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.  [ 1 post ] 
Author Message
 Post subject: unresolvableobjectexception
PostPosted: Mon Feb 04, 2008 5:42 am 
Regular
Regular

Joined: Fri May 05, 2006 11:54 am
Posts: 51
Hi,

I have a bug with the under the following circumstances.

I have a class named a CallTreeContact. The mapping file is displayed below:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
   <class name="ncontinuity2.core.domain.CallTreeContact,ncontinuity2.core" table="CallTreeContacts" lazy="true">
      <cache usage="read-write"/>
      <id name="Uid" column="uid" type="System.Guid" unsaved-value="00000000-0000-0000-0000-000000000000">
         <generator class="guid"/>
      </id>
      <many-to-one name="CallTree" column="calltreeuid" class="ncontinuity2.core.domain.CallTree,ncontinuity2.core" not-null="true" cascade="none" lazy="proxy"/>
      <many-to-one name="Contact" column="contactuid" class="ncontinuity2.core.domain.Contact,ncontinuity2.core" not-null="true" cascade="none" lazy="false"/>
      <many-to-one name="Parent" column="parentuid" class="ncontinuity2.core.domain.CallTreeContact,ncontinuity2.core" not-null="false" cascade="none" lazy="false"/>
      <many-to-one name="CallTreeContactRole" column="contactcalltreeid" class="ncontinuity2.core.domain.CallTreeContactRole,ncontinuity2.core" lazy="false" cascade="none" not-null="true"/>
      <bag name="Children" table="CallTreeContacts" inverse="true" cascade="all-delete-orphan" lazy="true">
         <cache usage="read-write"/>
         <key column="parentuid"/>
         <one-to-many class="ncontinuity2.core.domain.CallTreeContact,ncontinuity2.core"/>
      </bag>
   </class>
</hibernate-mapping>


This class contains a bag of objects of the same type (Children). The problem I am having is when I want to delete one of these objects from the bag. I have the following code:

Code:
[Transaction(TransactionMode.RequiresNew)]
public virtual CallTreeContact RemoveResponderFromPrincipal(Guid callTreeUid, Guid responderUid)
{
    ISession session = _sessionManager.OpenSession();
    CallTree callTree = _commonDao.GetObjectById<CallTree, Guid>(callTreeUid);

    CallTreeContact responder = (from ct in callTree.Contacts
                                       where ct.Uid == responderUid
                                       select ct).First();

    CallTreeContact principal = responder.Parent;

    responder.Parent.Remove(responder);
    responder.Parent = null;
    return principal;
}


I am using Memcached as my caching provider. The problem I have is after this code runs the child object is deleted but it is not removed from the cache. If I stop the memcached service then everything works fine.

I get an unresolvableobjectexception or the familiar error message:

No row with the given identifier exists[ncontinuity2.core.domain.CallTreeContact#---]

Can anyone tell me why this object is not being removed from the cache?

Can I programmatically remove it from the cache?

Can anyone spot what I am doing wrong?

Cheers

Paul


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.