/// <summary> /// Configure this instance for use with an immutable kernel. /// </summary> /// <returns></returns> public EngineConfiguration ForImmutability() { Kernel = Kernels.Immutability; Synchronization = SynchronizationMode.None; Isolation = IsolationSettings.ForImmutability(); return(this); }
/// <summary> /// Create an EngineConfiguration instance using default values /// </summary> /// <param name="targetLocation"></param> public EngineConfiguration(string targetLocation = null) { JournalPath = targetLocation; //Set default values Kernel = Kernels.Optimistic; JournalStorage = StorageType.File; LockTimeout = DefaultTimeout; Synchronization = SynchronizationMode.ReadWrite; AsynchronousJournaling = false; MaxBytesPerJournalSegment = DefaultMaxBytesPerJournalSegment; MaxEntriesPerJournalSegment = DefaultMaxCommandsPerJournalSegment; PacketOptions = null; PersistenceMode = PersistenceMode.Journaling; SqlSettings = new SqlSettings(); Isolation = new IsolationSettings(); IsolatedTypes = new HashSet <Type>(); Registry = new TeenyIoc(); Register <IAuthorizer>(c => new Authorizer(Permission.Allowed)); Register <IFormatter>(c => new BinaryFormatter(), FormatterUsage.Default.ToString()); InitSynchronizers(); InitStoreTypes(); InitKernels(); }
protected Kernel(EngineConfiguration config, Model model) { Synchronizer = config.CreateSynchronizer(); _model = model; Isolation = config.Isolation; }