I wouldn't build dtos after the commit, because you can't use lazy
loading then.

Flush should actually synchronize all the changes. So I'm also
wondering ...

On 13 Aug., 22:42, Luke Bakken <[email protected]> wrote:
> Hello everyone,
>
> Just wanted to check that this is expected behavior in NHibernate. I
> have services that, basically use this pattern to build DTOs:
>
> Start transaction
>     Do stuff with entities
>     Flush
>     Build DTOs from entites
> Commit transaction
>
> The problem is that certain operations update the version of the
> entity when the Commit happens, not the Flush, so my DTOs won't have
> the correct entity version. The attached solution demonstrates this.
> If this is expected behavior, I can just build the DTOs after the
> Commit, but I thought I'd just ask the group, as it seems all other
> pending work is flushed when Flush() is called.
>
> Thanks,
> Luke
>
>  TestNHibernate.zip
> 11KAnzeigenHerunterladen
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to