German,
Thanks for your efforts, I really appreciate it. I went with CustomComponentActivator approach and it is available in the trunk.
var model = new ComponentModel(id, typeof(ISessionFactory), typeof(Empty));
model.LifestyleType = LifestyleType.Singleton;
model.ExtendedProperties[Constants.SessionFactoryConfiguration] = cfg;
model.CustomComponentActivator = typeof (SessionFactoryActivator);
Kernel.AddCustomComponent( model );
sessionFactoryResolver.RegisterAliasComponentIdMapping(alias, id);
I ensured that SesisonFactory is singleton and activated viaa SessionFactoryActivator.
and in the activator, all I did is that
public override object Create(CreationContext context)
{
var configuration = Model.ExtendedProperties[Constants.SessionFactoryConfiguration]
as Configuration;
return configuration.BuildSessionFactory();
}
I hope this helps.