I try to explain:

I have this class/method

public class Transaction
{
 ...
public static void Process(var param1,var param2,ISession session)
{
  //.. Here is a lot of processing going on
  session.save(someObject); // after many filtering
 // again processing
 session.update(someObject);
 // and it goes on like this
}
}

public class UI_Form
{
   public void OnClickProcess(...)
{
   //start Unit of work
   using (ISession sess=NhibernateHelper.GetSession())
   using (ITransaction tx = sess.BeginTransaction())
   {
       Transaction.Process(param1,param2,sess);
       tx.Commit();

   }

}
}

I'm using the Transacion.Process(..) in other places too,
I was asking whether this is a good approach to pass the Session to
the Process method
or if it is better to return a Collection of objects to process and
then with a foreach inserting
the objects in the Unit of Work?

Thank you


On Oct 18, 10:06 am, Oskar Berggren <[email protected]> wrote:
> Too little context I'm afraid. The code in the link mentions threads.
> What threads? What are you trying to do?
>
> /Oskar
>
> 2010/10/18 Visar Uruqi <[email protected]>:
>
> > Is there a better way to do the same?
>
> > Click the image below to see what I mean (read the coment lines in the
> > image):
> >http://www.probit-kos.com/images/example2.png
>
> > What do you recommend me to do?
>
> > --
> > 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 
> > athttp://groups.google.com/group/nhusers?hl=en.

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