Hi Binti,

There is an issue in your code. The cache that is used for transaction 
operations is not transaction, it’s atomic. 
The following code below will properly create the transaction cache for you and 
you will get the timeout exception

this.ignite = Ignition.start("examples/config/example-ignite.xml");


CacheConfiguration<String, String> cc = new CacheConfiguration<String, 
String>();
cc.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
cc.setName("CacheA");

cacheA = ignite.getOrCreateCache(cc);


In addition I have a couple of more comments in advance:

1) You don’t need to rollback a transaction if it fails. This will be done 
automatically.

2) There is no big sense to use the timeout for OPTIMISTIC/SERIALIZABLE 
transactions because they are deadlock free.
https://apacheignite.readme.io/v1.6/docs/transactions#deadlock-free-transactions
 
<https://apacheignite.readme.io/v1.6/docs/transactions#deadlock-free-transactions>

With this kind of transactions you should to process 
TransactionOptimisticException. Refer to example that is at the end of this 
paragraph
https://apacheignite.readme.io/v1.6/docs/transactions#optimistic-transactions 
<https://apacheignite.readme.io/v1.6/docs/transactions#optimistic-transactions>

—
Denis

> On Jun 15, 2016, at 11:59 PM, bintisepaha <[email protected]> wrote:
> 
> TestTxnTimout.java
> <http://apache-ignite-users.70518.x6.nabble.com/file/n5656/TestTxnTimout.java>
>   
> 
> I have attached the test case. Instead of my cache-local file, you can use
> the default cache config file, since I am declaring the cache in java code.
> 
> Thread A never times out. I have even tried to put Thread.sleep() in it. why
> does it not timeout? 
> The issue we saw in our UAT environment was the thread not timing out at
> commit() but here i can see that no matter which point the thread is - it
> never times out.
> 
> Appreciate your help,
> Binti
> 
> 
> 
> --
> View this message in context: 
> http://apache-ignite-users.70518.x6.nabble.com/transaction-not-timing-out-tp5540p5656.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to