Example #1
0
        public void TestTransactionConfigurationCopyCtor()
        {
            var sourceCfg = new TransactionClientConfiguration
            {
                DefaultTimeout = TimeSpan.MaxValue,
                DefaultTransactionConcurrency = TransactionConcurrency.Pessimistic,
                DefaultTransactionIsolation   = TransactionIsolation.Serializable
            };

            var resultCfg = new TransactionClientConfiguration(sourceCfg);

            Assert.AreEqual(sourceCfg.DefaultTimeout, resultCfg.DefaultTimeout);
            Assert.AreEqual(sourceCfg.DefaultTransactionConcurrency, resultCfg.DefaultTransactionConcurrency);
            Assert.AreEqual(sourceCfg.DefaultTransactionIsolation, resultCfg.DefaultTransactionIsolation);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="IgniteClientConfiguration"/> class.
        /// </summary>
        /// <param name="cfg">The configuration to copy.</param>
        public IgniteClientConfiguration(IgniteClientConfiguration cfg) : this()
        {
            if (cfg == null)
            {
                return;
            }

#pragma warning disable 618
            Host = cfg.Host;
            Port = cfg.Port;
#pragma warning restore 618
            SocketSendBufferSize    = cfg.SocketSendBufferSize;
            SocketReceiveBufferSize = cfg.SocketReceiveBufferSize;
            TcpNoDelay    = cfg.TcpNoDelay;
            SocketTimeout = cfg.SocketTimeout;

            if (cfg.BinaryConfiguration != null)
            {
                BinaryConfiguration = new BinaryConfiguration(cfg.BinaryConfiguration);
            }

            BinaryProcessor  = cfg.BinaryProcessor;
            SslStreamFactory = cfg.SslStreamFactory;

            UserName                 = cfg.UserName;
            Password                 = cfg.Password;
            Endpoints                = cfg.Endpoints == null ? null : cfg.Endpoints.ToList();
            ReconnectDisabled        = cfg.ReconnectDisabled;
            EnablePartitionAwareness = cfg.EnablePartitionAwareness;
            Logger          = cfg.Logger;
            ProtocolVersion = cfg.ProtocolVersion;

            if (cfg.TransactionConfiguration != null)
            {
                TransactionConfiguration = new TransactionClientConfiguration(cfg.TransactionConfiguration);
            }

            RetryLimit        = cfg.RetryLimit;
            RetryPolicy       = cfg.RetryPolicy;
            EnableHeartbeats  = cfg.EnableHeartbeats;
            HeartbeatInterval = cfg.HeartbeatInterval;
        }
Example #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="ignite">Ignite.</param>
 /// <param name="cfg"></param>
 public TransactionsClient(IgniteClient ignite, TransactionClientConfiguration cfg)
 {
     _ignite    = ignite;
     _cfg       = cfg ?? new TransactionClientConfiguration();
     _txManager = new ClientCacheTransactionManager(this);
 }