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