Sebastian Talamoni has written great article. I can understand now the
idea of CpBT, but... There is an example, where we are creating new
Repository and loading data to DataGridView:

using (Repository repository = new Repository
(RepositoryMode.ReadOnly))
{
    dataGridView1.DataSource = repository.ProductDAO.GetAll();
}

and in the article there is a note:
"Please note that all DataBinding raised events are still inside that
scope, otherwise we would not be able to access lazy loading or
navigate through the object model (if you use lazy loading for parent
relations)."

Great! In this example we can select one of the rows in the grid and
click EDIT. There, we can change some properties and click SAVE
(everything in THE SAME unit of work). Ok. But what happens when we
receive an exception from database (for example, in database there is
row with the same name which is unique). Then system crashes! Why?
Because we don't have session that is connected with our DataGridView
anymore (as a result of exception from database).

I'm powerless.... There are situations, where we can't close session,
which is active in our unit of work.

So, my question is: do I have to split: (loading data) and (saving and
deleting data) into two unit of works?

Chris

On 21 Kwi, 18:03, Germán Schuager <[email protected]> wrote:
> Here you have other links that may help you:
>
> http://fgheysels.blogspot.com/2008/07/nhibernate-session-management.htmlhttp://stalamoni.blogspot.com/2007/12/nhibernate-and-winforms-article...http://blog.schuager.com/2009/03/rich-client-nhibernate-session.html

--~--~---------~--~----~------------~-------~--~----~
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