I have the following code in my application start method along with the code to setup the container and factory support. The factory method seems to only be called once instead of every time the session is needed.
_container.Kernel.Register(
Component.For<ISession>().LifeStyle.Transient
.UsingFactoryMethod(() =>
{
//Any line of code will only be hit once the first time ISession is requested.
}));
I was initially using build 1509 from the trunk, but updated to build 1548 with the same result. Please let me know if you need more information to help me.
Note: This is cross posted to the castle mailing list awaiting approval.
Note 2: This code works with the latest release version of windsor. However, we are working off of the trunk build because we needed the functionality from changeset 5927 (created by mausch on 13 August 2009).
See: