private void InstallFixture(INakedObjectPersistor persistor, object fixture) { persistor.InitDomainObject(fixture); // first, install any child fixtures (if this is a composite. object[] childFixtures = GetFixtures(fixture); InstallFixtures(persistor, childFixtures); // now, install the fixture itself try { Log.Info("installing fixture: " + fixture); persistor.StartTransaction(); InstallFixture(fixture); persistor.EndTransaction(); Log.Info("fixture installed"); } catch (Exception e) { Log.Error("installing fixture " + fixture.GetType().FullName + " failed (" + e.Message + "); aborting fixture ", e); try { persistor.AbortTransaction(); } catch (Exception e2) { Log.Error("failure during abort", e2); } throw; } }
public static void Abort(INakedObjectPersistor objectManager, IFacetHolder holder) { Log.Info("exception executing " + holder + ", aborting transaction"); try { objectManager.AbortTransaction(); } catch (Exception e2) { Log.Error("failure during abort", e2); } }