Hello Maximilian, Sorry, I don't mean to frown on any work, I believe the integration is brilliant. I just figured that when calling OpenSession on the ISessionManager, since the resulting call is either Open or GetCurrent, I would of assumed that the ISessionManager would be thread aware/thread safe since on subsequent calls, on the container, it forces it to look for the last ambient session, which could be on another thread. If we were given the option to Open a new ISession, with ISessionManager, regardless of existing ISession(s) then I would of not made that assumption.
Since we can't directly open a new ISession if one is present using ISessionManager, do correct me if I am wrong, is the suggestion made to me on StackOverflow a sound one? Can I reference the SessionFactory from the container using IoC in much the same way I used it in my example? I guess that would then solve my issue. Unless of course, there is a better practice way of using the ISessionManager thread-safe? If there is, are there any examples anywhere? I have yet to find any and have spent a day looking. Thanks for your time, Anthony On Apr 26, 10:36 pm, Maximilian Raditya <[email protected]> wrote: > Hello, > > I don't honestly understand how you are expecting it to be thread-safe. Mind > elaborating about it more? I mean what you expect from it to behave, and how > it doesn't meet your expectation. > > AFAIK, NHibernate ISession is also NOT thread-safe, but ISessionFactory IS > thread-safe, as a comparison. > > -- > Regards, > > Maximilian Haru Raditya > > On Wed, Apr 27, 2011 at 1:37 AM, Anthony Phillips <[email protected]>wrote: > > > > > > > > > Hello there, > > > I'm hoping someone can help me and explain the way to do things > > properly. > > > I posted my question here: > > >http://stackoverflow.com/questions/5782696/thread-safe-issue-with-cas... > > > I see no point in retyping it out but if you have a look at that and > > then keep this in mind. How can I use ISessionManager with other > > threads? > > > Thanks, > > > Anthony > > > -- > > 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. -- 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.
