Exception "Illegal attempt to associate a collection with two open sessions" when saving object
- by Alex
I am using CastleProject ActiveRecord and I use lazy load feature of this ORM. In order to make lazy load work, it is required to create SessionScope. I do this in Program.cs:
public static SessionScope sessionScope;
private static void InitializeActiveRecord()
{
ActiveRecordStarter.Initialize();
sessionScope = new SessionScope();
}
This…