Have you tried creating a new session from inside the listener?
using (ISession childSession =
evt.Session.GetSession(EntityMode.Poco))
{
...
}
On Apr 4, 4:15 pm, David Laabs <[email protected]> wrote:
> I looked around a little bit in this forum and in the web...
>
> This seems to be a known issue in NHibernate for a long time... (see
> i.e.http://groups.google.com/group/nhusers/browse_thread/thread/d2424b6bd...)
>
> Is there no way to add new Entities during the save loop of
> NHibernate?
>
> I tried several other events and allmost everyone shows the same
> problem. NHibernate doesnt save new Entities...
>
> Since I'd like to stay in the same transaction ( changes of objects
> shouldn't show up in the log when the corresponding transactions
> rollback ), there seem to be no solution for this problem...
>
> I searched a way to collect all the changes (all new ObjectLog
> objects) and add them right before (or even right after) the commit of
> the last transaction. Is there an event for "PreCommit" or
> "PostCommit" in which I can save all my new logs? Then there should
> also be a "PostRollback" or "BeginTransaction" event to initialize my
> collection.
>
> Thanks for any help :-)
--
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.