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
        /// <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;
 }
 public void SetListeners(DocumentSessionListeners listeners)
 {
     this.Listeners = listeners;
 }
예제 #13
0
 public void SetListeners(DocumentSessionListeners listeners)
 {
     server.DocumentStore.SetListeners(listeners);
 }
예제 #14
0
 public EntityToJson(IDocumentStore documentStore, DocumentSessionListeners listeners)
 {
     this.documentStore = documentStore;
     Listeners = listeners;
 }
		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;
	    }