Is this ISession handled by the SessionScope - Castle ActiveRecord
- by oillio
Can I do this?
I have the following in my code:
public class ARClass : ActiveRecordBase<ARClass>
{
---SNIP---
public void DoStuff()
{
using (new SessionScope())
{
holder.CreateSession(typeof(ARClass)).Lock(this, LockMode.None);
...Do some work...
}
}
}
So, as I'm sure you can guess, I am doing this so that I can access lazy loaded references in the object. It works great, however I am worried about creating an ISession like this and just dropping it. Does it get properly registered with the SessionScope and will the scope properly tare my ISession down when it is disposed of? Or do I need to do more to manage it myself?