Hi, in this case if you want just one session you can do this:
public void Action()
{
using (ISession session = sessionManager.OpenSession())
{
dao1.DoThis();
dao2.DoThat();
}
}
or if you plan to use ATM:
[Transaction(TransactionMode.Requires))
public void Action()
{
dao1.DoThis();
dao2.DoThat();
}
On Thu, Mar 5, 2009 at 7:25 PM, Jan Limpens <[email protected]> wrote:
> 2009/3/5 Tuna Toksoz <[email protected]>:
> > You inject ISessionManager
> >
> > like this
> >
> > public IList<Post> GetPostsByXXX()
> > {
> > using(ISession ses=this.sessionManager.OpenSession())
> > {
> > here you perform action.
> > }
> > }
>
> so if i had an action
>
> public void Action()
> {
> dao1.DoThis();
> dao2.DoThat();
> }
>
> and I followed your pattern, I would open two separate sessions?
>
>
> --
> Jan
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---