/// <summary>Default constructor.
        /// </summary>
        public MySqlCommandStore(OptionSetting optionSetting)
        {
            if (optionSetting != null)
            {
                _connectionString = optionSetting.GetOptionValue <string>("ConnectionString");
                _tableName        = optionSetting.GetOptionValue <string>("TableName");
                _uniqueIndexName  = optionSetting.GetOptionValue <string>("UniqueIndexName");
            }
            else
            {
                var setting = ENodeConfiguration.Instance.Setting.DefaultDBConfigurationSetting;
                _connectionString = setting.ConnectionString;
                _tableName        = setting.CommandTableName;
                _uniqueIndexName  = setting.CommandTableCommandIdUniqueIndexName;
            }

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_uniqueIndexName, "_uniqueIndexName");

            _jsonSerializer   = ObjectContainer.Resolve <IJsonSerializer>();
            _typeNameProvider = ObjectContainer.Resolve <ITypeNameProvider>();
            _ioHelper         = ObjectContainer.Resolve <IOHelper>();
            _logger           = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
        }
Beispiel #2
0
        /// <summary>Default constructor.
        /// </summary>
        public SqlServerCommandStore(OptionSetting optionSetting)
        {
            if (optionSetting != null)
            {
                _connectionString = optionSetting.GetOptionValue<string>("ConnectionString");
                _tableName = optionSetting.GetOptionValue<string>("TableName");
                _uniqueIndexName = optionSetting.GetOptionValue<string>("UniqueIndexName");
            }
            else
            {
                var setting = ENodeConfiguration.Instance.Setting.DefaultDBConfigurationSetting;
                _connectionString = setting.ConnectionString;
                _tableName = setting.CommandTableName;
                _uniqueIndexName = setting.CommandTableCommandIdUniqueIndexName;
            }

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_uniqueIndexName, "_uniqueIndexName");

            _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
            _typeNameProvider = ObjectContainer.Resolve<ITypeNameProvider>();
            _ioHelper = ObjectContainer.Resolve<IOHelper>();
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
        }
        public SqlServerLockService(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString = optionSetting.GetOptionValue<string>("ConnectionString");
            _tableName = optionSetting.GetOptionValue<string>("TableName");

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");

            _lockKeySqlFormat = "SELECT * FROM [" + _tableName + "] WITH (UPDLOCK) WHERE [Name] = '{0}'";
        }
Beispiel #4
0
        public SqlServerLockService(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString = optionSetting.GetOptionValue <string>("ConnectionString");
            _tableName        = optionSetting.GetOptionValue <string>("TableName");

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");

            _lockKeySqlFormat = "SELECT * FROM [" + _tableName + "] WITH (UPDLOCK) WHERE [Name] = '{0}'";
        }
Beispiel #5
0
        public MySqlSequenceMessagePublishedVersionStore(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString = optionSetting.GetOptionValue <string>("ConnectionString");
            _tableName        = optionSetting.GetOptionValue <string>("TableName");
            _primaryKeyName   = "PRIMARY";

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");

            _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
        }
        public SqlServerSequenceMessagePublishedVersionStore(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString = optionSetting.GetOptionValue<string>("ConnectionString");
            _tableName = optionSetting.GetOptionValue<string>("TableName");
            _primaryKeyName = optionSetting.GetOptionValue<string>("PrimaryKeyName");

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_primaryKeyName, "_primaryKeyName");

            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
        }
Beispiel #7
0
        /// <summary>Default constructor.
        /// </summary>
        public MySqlCommandStore(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString = optionSetting.GetOptionValue <string>("ConnectionString");
            _tableName        = optionSetting.GetOptionValue <string>("TableName");
            _primaryKeyName   = "PRIMARY";

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");

            _jsonSerializer   = ObjectContainer.Resolve <IJsonSerializer>();
            _typeNameProvider = ObjectContainer.Resolve <ITypeNameProvider>();
            _ioHelper         = ObjectContainer.Resolve <IOHelper>();
            _logger           = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
        }
        /// <summary>Default constructor.
        /// </summary>
        public SqlServerCommandStore(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString = optionSetting.GetOptionValue<string>("ConnectionString");
            _tableName = optionSetting.GetOptionValue<string>("TableName");
            _primaryKeyName = optionSetting.GetOptionValue<string>("PrimaryKeyName");

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_primaryKeyName, "_primaryKeyName");

            _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
            _typeNameProvider = ObjectContainer.Resolve<ITypeNameProvider>();
            _ioHelper = ObjectContainer.Resolve<IOHelper>();
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
        }
        public MySqlMessageHandleRecordStore(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString                = optionSetting.GetOptionValue <string>("ConnectionString");
            _oneMessageTableName             = optionSetting.GetOptionValue <string>("OneMessageTableName");
            _oneMessageTablePrimaryKeyName   = "PRIMARY"; //MySql's primary key name always be "PRIMARY"
            _twoMessageTableName             = optionSetting.GetOptionValue <string>("TwoMessageTableName");
            _twoMessageTablePrimaryKeyName   = "PRIMARY";
            _threeMessageTableName           = optionSetting.GetOptionValue <string>("ThreeMessageTableName");
            _threeMessageTablePrimaryKeyName = "PRIMARY";

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_oneMessageTableName, "_oneMessageTableName");
            Ensure.NotNull(_twoMessageTableName, "_twoMessageTableName");
            Ensure.NotNull(_threeMessageTableName, "_threeMessageTableName");
            _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
        }
        public MySqlLockService(OptionSetting optionSetting)
        {
            if (optionSetting != null)
            {
                _connectionString = optionSetting.GetOptionValue <string>("ConnectionString");
                _tableName        = optionSetting.GetOptionValue <string>("TableName");
            }
            else
            {
                var setting = ENodeConfiguration.Instance.Setting.DefaultDBConfigurationSetting;
                _connectionString = setting.ConnectionString;
                _tableName        = setting.LockKeyTableName;
            }

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            _lockKeySqlFormat = "SELECT * FROM `" + _tableName + "` WHERE `Name` = '{0}'";
        }
Beispiel #11
0
        public SqlServerLockService(OptionSetting optionSetting)
        {
            if (optionSetting != null)
            {
                _connectionString = optionSetting.GetOptionValue<string>("ConnectionString");
                _tableName = optionSetting.GetOptionValue<string>("TableName");
            }
            else
            {
                var setting = ENodeConfiguration.Instance.Setting.DefaultDBConfigurationSetting;
                _connectionString = setting.ConnectionString;
                _tableName = setting.LockKeyTableName;
            }

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");

            _lockKeySqlFormat = "SELECT * FROM [" + _tableName + "] WITH (UPDLOCK) WHERE [Name] = '{0}'";
        }
Beispiel #12
0
        public SqlServerLockService Initialize(OptionSetting optionSetting)
        {
            if (optionSetting != null)
            {
                _connectionString = optionSetting.GetOptionValue <string>("ConnectionString");
                _tableName        = optionSetting.GetOptionValue <string>("TableName");
            }
            else
            {
                var setting = ENodeConfiguration.Instance.Setting.DefaultDBConfigurationSetting;
                _connectionString = setting.ConnectionString;
                _tableName        = setting.LockKeyTableName;
            }

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");

            _lockKeySqlFormat = "SELECT * FROM [" + _tableName + "] WITH (UPDLOCK) WHERE [Name] = '{0}'";

            return(this);
        }
        public MySqlPublishedVersionStore(OptionSetting optionSetting)
        {
            if (optionSetting != null)
            {
                _connectionString = optionSetting.GetOptionValue <string>("ConnectionString");
                _tableName        = optionSetting.GetOptionValue <string>("TableName");
                _uniqueIndexName  = optionSetting.GetOptionValue <string>("UniqueIndexName");
            }
            else
            {
                var setting = ENodeConfiguration.Instance.Setting.DefaultDBConfigurationSetting;
                _connectionString = setting.ConnectionString;
                _tableName        = setting.PublishedVersionTableName;
                _uniqueIndexName  = setting.PublishedVersionUniqueIndexName;
            }

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_uniqueIndexName, "_uniqueIndexName");

            _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
        }
        public SqlServerPublishedVersionStore(OptionSetting optionSetting)
        {
            if (optionSetting != null)
            {
                _connectionString = optionSetting.GetOptionValue<string>("ConnectionString");
                _tableName = optionSetting.GetOptionValue<string>("TableName");
                _uniqueIndexName = optionSetting.GetOptionValue<string>("UniqueIndexName");
            }
            else
            {
                var setting = ENodeConfiguration.Instance.Setting.DefaultDBConfigurationSetting;
                _connectionString = setting.ConnectionString;
                _tableName = setting.PublishedVersionTableName;
                _uniqueIndexName = setting.PublishedVersionUniqueIndexName;
            }

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_uniqueIndexName, "_uniqueIndexName");

            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
        }
Beispiel #15
0
        public MySqlEventStore(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString  = optionSetting.GetOptionValue <string>("ConnectionString");
            _tableName         = optionSetting.GetOptionValue <string>("TableName");
            _primaryKeyName    = "PRIMARY";
            _commandIndexName  = optionSetting.GetOptionValue <string>("CommandIndexName");
            _bulkCopyBatchSize = optionSetting.GetOptionValue <int>("BulkCopyBatchSize");
            _bulkCopyTimeout   = optionSetting.GetOptionValue <int>("BulkCopyTimeout");

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_commandIndexName, "_commandIndexName");
            Ensure.Positive(_bulkCopyBatchSize, "_bulkCopyBatchSize");
            Ensure.Positive(_bulkCopyTimeout, "_bulkCopyTimeout");

            _jsonSerializer  = ObjectContainer.Resolve <IJsonSerializer>();
            _eventSerializer = ObjectContainer.Resolve <IEventSerializer>();
            _ioHelper        = ObjectContainer.Resolve <IOHelper>();
            _logger          = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
        }
Beispiel #16
0
        public SqlServerEventStore Initialize(OptionSetting optionSetting)
        {
            if (optionSetting != null)
            {
                _connectionString  = optionSetting.GetOptionValue <string>("ConnectionString");
                _tableName         = optionSetting.GetOptionValue <string>("TableName");
                _tableCount        = optionSetting.GetOptionValue <int>("TableCount");
                _versionIndexName  = optionSetting.GetOptionValue <string>("VersionIndexName");
                _commandIndexName  = optionSetting.GetOptionValue <string>("CommandIndexName");
                _bulkCopyBatchSize = optionSetting.GetOptionValue <int>("BulkCopyBatchSize");
                _bulkCopyTimeout   = optionSetting.GetOptionValue <int>("BulkCopyTimeout");
            }
            else
            {
                var setting = ENodeConfiguration.Instance.Setting.DefaultDBConfigurationSetting;
                _connectionString  = setting.ConnectionString;
                _tableName         = setting.EventTableName;
                _tableCount        = setting.EventTableCount;
                _versionIndexName  = setting.EventTableVersionUniqueIndexName;
                _commandIndexName  = setting.EventTableCommandIdUniqueIndexName;
                _bulkCopyBatchSize = setting.EventTableBulkCopyBatchSize;
                _bulkCopyTimeout   = setting.EventTableBulkCopyTimeout;
            }

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_versionIndexName, "_versionIndexName");
            Ensure.NotNull(_commandIndexName, "_commandIndexName");
            Ensure.Positive(_bulkCopyBatchSize, "_bulkCopyBatchSize");
            Ensure.Positive(_bulkCopyTimeout, "_bulkCopyTimeout");

            _jsonSerializer  = ObjectContainer.Resolve <IJsonSerializer>();
            _eventSerializer = ObjectContainer.Resolve <IEventSerializer>();
            _ioHelper        = ObjectContainer.Resolve <IOHelper>();
            _logger          = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);

            SupportBatchAppendEvent = true;

            return(this);
        }
        public SqlServerMessageHandleRecordStore(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString = optionSetting.GetOptionValue<string>("ConnectionString");
            _oneMessageTableName = optionSetting.GetOptionValue<string>("OneMessageTableName");
            _oneMessageTablePrimaryKeyName = optionSetting.GetOptionValue<string>("OneMessageTablePrimaryKeyName");
            _twoMessageTableName = optionSetting.GetOptionValue<string>("TwoMessageTableName");
            _twoMessageTablePrimaryKeyName = optionSetting.GetOptionValue<string>("TwoMessageTablePrimaryKeyName");
            _threeMessageTableName = optionSetting.GetOptionValue<string>("ThreeMessageTableName");
            _threeMessageTablePrimaryKeyName = optionSetting.GetOptionValue<string>("ThreeMessageTablePrimaryKeyName");

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_oneMessageTableName, "_oneMessageTableName");
            Ensure.NotNull(_oneMessageTablePrimaryKeyName, "_oneMessageTablePrimaryKeyName");
            Ensure.NotNull(_twoMessageTableName, "_twoMessageTableName");
            Ensure.NotNull(_twoMessageTablePrimaryKeyName, "_twoMessageTablePrimaryKeyName");
            Ensure.NotNull(_threeMessageTableName, "_threeMessageTableName");
            Ensure.NotNull(_threeMessageTablePrimaryKeyName, "_threeMessageTablePrimaryKeyName");

            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
        }
Beispiel #18
0
        public SqlServerEventStore(OptionSetting optionSetting)
        {
            if (optionSetting != null)
            {
                _connectionString = optionSetting.GetOptionValue<string>("ConnectionString");
                _tableName = optionSetting.GetOptionValue<string>("TableName");
                _tableCount = optionSetting.GetOptionValue<int>("TableCount");
                _versionIndexName = optionSetting.GetOptionValue<string>("VersionIndexName");
                _commandIndexName = optionSetting.GetOptionValue<string>("CommandIndexName");
                _bulkCopyBatchSize = optionSetting.GetOptionValue<int>("BulkCopyBatchSize");
                _bulkCopyTimeout = optionSetting.GetOptionValue<int>("BulkCopyTimeout");
            }
            else
            {
                var setting = ENodeConfiguration.Instance.Setting.DefaultDBConfigurationSetting;
                _connectionString = setting.ConnectionString;
                _tableName = setting.EventTableName;
                _tableCount = setting.EventTableCount;
                _versionIndexName = setting.EventTableVersionUniqueIndexName;
                _commandIndexName = setting.EventTableCommandIdUniqueIndexName;
                _bulkCopyBatchSize = setting.EventTableBulkCopyBatchSize;
                _bulkCopyTimeout = setting.EventTableBulkCopyTimeout;
            }

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_versionIndexName, "_versionIndexName");
            Ensure.NotNull(_commandIndexName, "_commandIndexName");
            Ensure.Positive(_bulkCopyBatchSize, "_bulkCopyBatchSize");
            Ensure.Positive(_bulkCopyTimeout, "_bulkCopyTimeout");

            _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
            _eventSerializer = ObjectContainer.Resolve<IEventSerializer>();
            _ioHelper = ObjectContainer.Resolve<IOHelper>();
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);

            SupportBatchAppendEvent = true;
        }
Beispiel #19
0
        public SqlServerEventStore(OptionSetting optionSetting)
        {
            Ensure.NotNull(optionSetting, "optionSetting");

            _connectionString = optionSetting.GetOptionValue<string>("ConnectionString");
            _tableName = optionSetting.GetOptionValue<string>("TableName");
            _primaryKeyName = optionSetting.GetOptionValue<string>("PrimaryKeyName");
            _commandIndexName = optionSetting.GetOptionValue<string>("CommandIndexName");
            _bulkCopyBatchSize = optionSetting.GetOptionValue<int>("BulkCopyBatchSize");
            _bulkCopyTimeout = optionSetting.GetOptionValue<int>("BulkCopyTimeout");

            Ensure.NotNull(_connectionString, "_connectionString");
            Ensure.NotNull(_tableName, "_tableName");
            Ensure.NotNull(_primaryKeyName, "_primaryKeyName");
            Ensure.NotNull(_commandIndexName, "_commandIndexName");
            Ensure.Positive(_bulkCopyBatchSize, "_bulkCopyBatchSize");
            Ensure.Positive(_bulkCopyTimeout, "_bulkCopyTimeout");

            _jsonSerializer = ObjectContainer.Resolve<IJsonSerializer>();
            _eventSerializer = ObjectContainer.Resolve<IEventSerializer>();
            _ioHelper = ObjectContainer.Resolve<IOHelper>();
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
        }