private static void Run(string[] args) { Environment.SetEnvironmentVariable("hazelcast.logging.level", "info"); Environment.SetEnvironmentVariable("hazelcast.logging.type", "console"); var config = new ClientConfig(); config.GetNetworkConfig().AddAddress("127.0.0.1"); var client = HazelcastClient.NewHazelcastClient(config); var options = new TransactionOptions(); options.SetTransactionType(TransactionOptions.TransactionType.OnePhase); var ctx = client.NewTransactionContext(options); ctx.BeginTransaction(); try { var txMap = ctx.GetMap<string, string>("txn-map"); txMap.Put("foo", "bar"); ctx.CommitTransaction(); } catch { ctx.RollbackTransaction(); } var map = client.GetMap<string, string>("txn-map"); Console.WriteLine("Value of foo is " + map.Get("key")); map.Destroy(); client.Shutdown(); }
public void TestTxnTimeOut() { var options = new TransactionOptions(); options.SetTimeout(100, TimeUnit.Milliseconds); var context = Client.NewTransactionContext(options); Thread.Sleep(500); context.CommitTransaction(); }
internal TransactionProxy(HazelcastClient client, TransactionOptions options, IMember txOwner) { _options = options; _client = client; _txOwner = txOwner; }
public void TestNegativeTimeout() { var options = new TransactionOptions(); options.SetTimeout(-1, TimeUnit.Milliseconds); }
public void TestNegativeDurability() { var options = new TransactionOptions(); options.SetDurability(-1); }
internal TransactionProxy(HazelcastClient client, TransactionOptions options, IMember txOwner) { this.options = options; this.client = client; this.txOwner = txOwner; }