Thanks! Yeah, that section got rewritten so many times that I lost track of whether we were doing Sessions or EntityManagers.
Fixed now.