Hi guys, I am having a strange behavior on non-proxied objects with
NHibernate 3.1 and I am sure I am doing something wrong.
This is the code of the test, all is in one method
-----------------------------------------------------------------------------------------------------------------------
// create the object
using (var repository =
FixtureBoostrapper.Get<Repository>())
{
repository.UnitOfWork.StartTx();
repository.Insert(obj);
repository.UnitOfWork.CommitTx();
Assert.That(obj,
Has.Property("UniqueId").Not.EqualTo(Guid.Empty));
}
-----------------------------------------------------------------------------------------------------------------------
// delete the object
using (var repository =
FixtureBoostrapper.Get<WorkbookRepository>())
{
repository.UnitOfWork.StartTx();
repository.Delete(createdWorkbook);
--> !! EXCEPTION !!
repository.UnitOfWork.CommitTx();
}
-----------------------------------------------------------------------------------------------------------------------
It says that the object I am trying to delete is already attached to a
previous session, but the
previous version is disposed already ...
I do not use proxy and my classes are sealed.
This object is a root aggregate so no parents ...
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.