> The reason why you are experiencing issues, it is because you see the
> ORM as a dataset, and you don't realize that your entities is not
> attached to a db context.
I don't see ORM as DataSet in any way. How can you see that? :)
My entities are not attached to db context. They attached to db
context (ie NH) when I commit them to db.

> As any other object, if you just consider a POCO, what would you do to
> solve your issue ?

Write that myself. I will need some metadata to know the boundaries of
my aggregates.
I will need the same metadata that NH already have.

> If you need to cancel changes, you just need to reload the object from
> the db and evict the object from your session

I do this now. And it's counter intuitive at the minimum. As the
second it reduces performance. My db is far (not on my local machine
so effects are not so visible). And also this reduces scalability -
another hit of db. And now - what if during reload the object will be
deleted by someone else or it's state will be modified? This is
nowhere close to strong object transaction guarantee.

> Your problem is not related to Nh or winforms, webapps or services mays
> "cancel changes" on a loaded entity.
I don't have problem. I have badly performing application with which I
can live for now.
And I've just asked a question. As same as the guy who initially
started this discussion.

Frederic, have a look at TopLink's UnitOfWork. Just read the docs.
It's all clear how it is working. And I wish to have such behaviour
with NH.

> And at least, instrad of cloning, you could use a local binary
> serialisation, to restore a previous state.

It will we return me different instances. I do need original not being
changed.
If I use it to clone the object it will clone whatever it can reach
and I want cloning to respect cascades.

I'm interested in how do you use NH with winforms everyday and if
you're not busy drop me a line privately.

Thanks.

On 20 июн, 21:20, Frederic <[email protected]> wrote:
> I'm using NH with winforms everyday. And it's easy.
> The reason why you are experiencing issues, it is because you see the
> ORM as a dataset, and you don't realize that your entities is not
> attached to a db context.
>
> As any other object, if you just consider a POCO, what would you do to
> solve your issue ?
>
> If you need to cancel changes, you just need to reload the object from
> the db and evict the object from your session
>
> Your problem is not related to Nh or winforms, webapps or services mays
> "cancel changes" on a loaded entity.
>
> And at least, instrad of cloning, you could use a local binary
> serialisation, to restore a previous state.
--~--~---------~--~----~------------~-------~--~----~
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