コード例 #1
0
 public EmbeddableDocumentStore()
 {
     Conventions = new DocumentConvention();
     Listeners = new DocumentSessionListeners();
     Configuration = new RavenConfiguration();
     EnlistInDistributedTransactions = true;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DocumentSession"/> class.
 /// </summary>
 public DocumentSession(string dbName, DocumentStore documentStore,
                        DocumentSessionListeners listeners,
                        Guid id,
                        IDatabaseCommands databaseCommands)
     : base(dbName, documentStore, listeners, id)
 {
     DatabaseCommands = databaseCommands;
 }
コード例 #3
0
        public BulkInsertOperation(string database, IDocumentStore documentStore, DocumentSessionListeners listeners, BulkInsertOptions options)
        {
            this.documentStore = documentStore;
            databaseCommands   = database == null
                                                   ? documentStore.DatabaseCommands.ForSystemDatabase()
                                                   : documentStore.DatabaseCommands.ForDatabase(database);

            generateEntityIdOnTheClient = new GenerateEntityIdOnTheClient(documentStore, entity => documentStore.Conventions.GenerateDocumentKey(database, databaseCommands, entity));
            operation    = databaseCommands.GetBulkInsertOperation(options);
            entityToJson = new EntityToJson(documentStore, listeners);
        }
コード例 #4
0
		public BulkInsertOperation(string database, IDocumentStore documentStore, DocumentSessionListeners listeners, BulkInsertOptions options)
		{
			this.documentStore = documentStore;
			databaseCommands = database == null
				                   ? documentStore.DatabaseCommands.ForSystemDatabase()
				                   : documentStore.DatabaseCommands.ForDatabase(database);

			generateEntityIdOnTheClient = new GenerateEntityIdOnTheClient(documentStore, entity => documentStore.Conventions.GenerateDocumentKey(database, databaseCommands, entity));
			operation = databaseCommands.GetBulkInsertOperation(options);
			entityToJson = new EntityToJson(documentStore, listeners);
		}
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InMemoryDocumentSessionOperations"/> class.
 /// </summary>
 protected InMemoryDocumentSessionOperations(
     DocumentStoreBase documentStore,
     DocumentSessionListeners listeners,
     Guid id)
 {
     Id = id;
     this.documentStore                 = documentStore;
     this.listeners                     = listeners;
     ResourceManagerId                  = documentStore.ResourceManagerId;
     UseOptimisticConcurrency           = false;
     AllowNonAuthoritativeInformation   = true;
     NonAuthoritativeInformationTimeout = TimeSpan.FromSeconds(15);
     MaxNumberOfRequestsPerSession      = documentStore.Conventions.MaxNumberOfRequestsPerSession;
 }
コード例 #6
0
ファイル: DocumentSession.cs プロジェクト: tal952/ravendb
        /// <summary>
        /// Initializes a new instance of the <see cref="DocumentSession"/> class.
        /// </summary>
        public DocumentSession(DocumentStore documentStore,
                               DocumentSessionListeners listeners,
                               Guid id,
                               IDatabaseCommands databaseCommands
#if !NET_3_5
                               , IAsyncDatabaseCommands asyncDatabaseCommands
#endif
                               )
            : base(documentStore, listeners, id)
        {
#if !NET_3_5
            this.asyncDatabaseCommands = asyncDatabaseCommands;
#endif
            DatabaseCommands = databaseCommands;
        }
コード例 #7
0
        public BulkInsertOperation(string database, IDocumentStore documentStore, DocumentSessionListeners listeners, BulkInsertOptions options, IDatabaseChanges changes)
        {
            this.documentStore = documentStore;

            database = database ?? MultiDatabase.GetDatabaseName(documentStore.Url);

            // Fitzchak: Should not be ever null because of the above code, please refactor this.
            DatabaseCommands = database == null
                                ? documentStore.AsyncDatabaseCommands.ForSystemDatabase()
                                : documentStore.AsyncDatabaseCommands.ForDatabase(database);

            generateEntityIdOnTheClient = new GenerateEntityIdOnTheClient(documentStore, entity => documentStore.Conventions.GenerateDocumentKeyAsync(database, DatabaseCommands, entity).ResultUnwrap());
            Operation    = GetBulkInsertOperation(options, DatabaseCommands, changes);
            entityToJson = new EntityToJson(documentStore, listeners);
        }
コード例 #8
0
		public BulkInsertOperation(string database, IDocumentStore documentStore, DocumentSessionListeners listeners, BulkInsertOptions options, IDatabaseChanges changes)
		{
			this.documentStore = documentStore;

			database = database ?? MultiDatabase.GetDatabaseName(documentStore.Url);

			// Fitzchak: Should not be ever null because of the above code, please refactor this.
			DatabaseCommands = database == null
				? documentStore.AsyncDatabaseCommands.ForSystemDatabase()
				: documentStore.AsyncDatabaseCommands.ForDatabase(database);

			generateEntityIdOnTheClient = new GenerateEntityIdOnTheClient(documentStore.Conventions, entity => documentStore.Conventions.GenerateDocumentKeyAsync(database, DatabaseCommands, entity).ResultUnwrap());
			Operation = GetBulkInsertOperation(options, DatabaseCommands, changes);
			entityToJson = new EntityToJson(documentStore, listeners);
		}
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InMemoryDocumentSessionOperations"/> class.
 /// </summary>
 protected InMemoryDocumentSessionOperations(
     string dbName,
     DocumentStoreBase documentStore,
     DocumentSessionListeners listeners,
     Guid id)
 {
     Id                                 = id;
     this.dbName                        = dbName;
     this.documentStore                 = documentStore;
     this.listeners                     = listeners;
     ResourceManagerId                  = documentStore.ResourceManagerId;
     UseOptimisticConcurrency           = false;
     AllowNonAuthoritativeInformation   = true;
     NonAuthoritativeInformationTimeout = TimeSpan.FromSeconds(15);
     MaxNumberOfRequestsPerSession      = documentStore.Conventions.MaxNumberOfRequestsPerSession;
     GenerateEntityIdOnTheClient        = new GenerateEntityIdOnTheClient(documentStore, GenerateKey);
     EntityToJson                       = new EntityToJson(documentStore, listeners);
 }
コード例 #10
0
        public BulkInsertOperation(string database, IDocumentStore documentStore, DocumentSessionListeners listeners)
        {
            this.documentStore = documentStore;

            database = database ?? MultiDatabase.GetDatabaseName(documentStore.Url);

            // Fitzchak: Should not be ever null because of the above code, please refactor this.
            DatabaseCommands = database == null
                ? documentStore.AsyncDatabaseCommands.ForSystemDatabase()
                : documentStore.AsyncDatabaseCommands.ForDatabase(database);

            generateEntityIdOnTheClient = new GenerateEntityIdOnTheClient(documentStore.Conventions, entity =>
                                                                          AsyncHelpers.RunSync(() => documentStore.Conventions.GenerateDocumentKeyAsync(database, DatabaseCommands, entity)));

            // ReSharper disable once VirtualMemberCallInContructor
            Operation    = GetBulkInsertOperation(DatabaseCommands);
            entityToJson = new EntityToJson(documentStore, listeners);
        }
コード例 #11
0
 public EntityToJson(IDocumentStore documentStore, DocumentSessionListeners listeners)
 {
     this.documentStore = documentStore;
     Listeners          = listeners;
 }
コード例 #12
0
 public void SetListeners(DocumentSessionListeners listeners)
 {
     this.Listeners = listeners;
 }
コード例 #13
0
 public void SetListeners(DocumentSessionListeners listeners)
 {
     server.DocumentStore.SetListeners(listeners);
 }
コード例 #14
0
ファイル: EntityToJson.cs プロジェクト: j2jensen/ravendb
 public EntityToJson(IDocumentStore documentStore, DocumentSessionListeners listeners)
 {
     this.documentStore = documentStore;
     Listeners = listeners;
 }
コード例 #15
0
		public ChunkedBulkInsertOperation(string database, IDocumentStore documentStore, DocumentSessionListeners listeners, BulkInsertOptions options, IDatabaseChanges changes, int chunkSize)
			: base(database, documentStore, listeners, options, changes)
		{
			Operation = new ChunkedRemoteBulkInsertOperation(options, (AsyncServerClient)DatabaseCommands, changes, chunkSize);
		}
コード例 #16
0
	    public void SetListeners(DocumentSessionListeners newListeners)
	    {
            listeners = newListeners;
	    }