public OptimisticConcurrencyCallback(ConcurrencyChecks mode, object id, VersionTracker versions, Guid newVersion, Guid?oldVersion, Action <Guid> setVersion)
 {
     _mode       = mode;
     _id         = id;
     _versions   = versions;
     _newVersion = newVersion;
     _oldVersion = oldVersion;
     _setVersion = setVersion;
 }
示例#2
0
        public UpdateBatch(DocumentStore store, IManagedConnection connection, VersionTracker versions, CharArrayTextWriter.IPool writerPool, ITenant tenant, ConcurrencyChecks concurrency)
        {
            _store      = store;
            _writerPool = writerPool;
            Versions    = versions ?? throw new ArgumentNullException(nameof(versions));

            _commands.Push(new BatchCommand(_store.Serializer, tenant));
            Connection  = connection;
            Concurrency = concurrency;
            TenantId    = tenant.TenantId;
            _tenant     = tenant;
        }
示例#3
0
        public UpdateBatch(DocumentStore store, IManagedConnection connection, VersionTracker versions, MemoryPool <char> writerPool, ITenant tenant, ConcurrencyChecks concurrency)
        {
            _store      = store;
            _writerPool = writerPool;
            Versions    = versions ?? throw new ArgumentNullException(nameof(versions));

            var current = new BatchCommand(_store.Serializer, tenant);

            _commands.Add(current);

            _current = current;

            Connection  = connection;
            Concurrency = concurrency;
            TenantId    = tenant.TenantId;
            _tenant     = tenant;
        }
示例#4
0
        public DocumentSession(DocumentStore store, IManagedConnection connection, IQueryParser parser, IIdentityMap identityMap, ITenant tenant, ConcurrencyChecks concurrency, IList <IDocumentSessionListener> localListeners)
            : base(store, connection, parser, identityMap, tenant)

        {
            _connection = connection;
            Listeners   = _store.Options.Listeners.Concat(localListeners).ToList();

            IdentityMap = identityMap;
            Concurrency = concurrency;

            _unitOfWork = new UnitOfWork(_store, tenant);

            if (IdentityMap is IDocumentTracker)
            {
                _unitOfWork.AddTracker(IdentityMap.As <IDocumentTracker>());
            }

            Events = new EventStore(this, _store, _connection, _unitOfWork, tenant);
        }