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: no collection snapshot for orphan delete
PostPosted: Wed Jun 04, 2008 2:51 pm 
Newbie

Joined: Thu May 29, 2008 4:11 am
Posts: 8
Hi,
when i try to execute the following code :

Code:
    Dim alfaObj As ICloneable = DirectCast(obj, ICloneable)
            Dim uow As IUnitOfWork = Spring.Context.Support.ContextRegistry.GetContext().GetObject("UnitOfWork")
            Delete(obj, alfaDB)

            uow.Detach(alfaObj)


            If DocSuiteContext.Current.IsDocumentEnabled Then
                Dim betaObj As ICloneable = alfaObj.Clone()
                uow.DbName = betaDB
                uow.Clear()
              [b]  Delete(betaObj, betaDB)[/b]
            End If

            If DocSuiteContext.Current.IsResolutionEnabled Then
                Dim gammaObj As ICloneable = alfaObj.Clone()
                uow.DbName = gammaDB
                uow.Clear()
              Delete(gammaObj, gammaDB)
            End If

            Return True


at the line in bold i throw the exception reported in the subject.
The Mapping is the following :

Code:
    <class name="MainEntity" table="MainEntity" >
    <!--<cache usage="read-write"/>-->
    <id name="Id" column="idMainEntity">
      <generator class="assigned"/>
    </id>
    <property name="Name" column="Name" />
    <property name="EMailAddress" column="EMailAddress" />
    <many-to-one name="Father" column="idMainEntityFather" class="MainEntity" />
    <property name="FullIncrementalPath" column="FullIncrementalPath" />
    <many-to-one name="DocmLocation" column="DocmLocation" class="Location" />
    <many-to-one name="ReslLocation" column="ReslLocation" class="Location" />
    <many-to-one name="ProtLocation" column="ProtLocation" class="Location" />
    <property name="IsActive" column="isActive" />
    <property name="RegistrationDate" column="RegistrationDate" />
    <property name="RegistrationUser" column="RegistrationUser" />
    <property name="LastChangeDate" column="LastChangedDate" />
    <property name="LastChangeUser" column="LastChangedUser" />
    <bag name="MainEntityGroups" table="MainEntityGroup" cascade="delete" inverse="true">
      <key column="idMainEntity"/>
      <one-to-many class="MainEntityGroup"/>
    </bag>
    <bag name="AlfaDocs" table="AlfaDocMainEntity" cascade="all-delete-orphan" inverse="true">
      <key column="idMainEntity" />
      <one-to-many class="AlfaDocMainEntity" />
    </bag>
  </class>


Any suggestion?
Thank you.
Simone


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.