2 Replies Latest reply: Dec 13, 2011 7:10 AM by Sudheer Krishna RSS

Understanding infinispan role in JTA transaction prepare phase

Sudheer Krishna Novice

HI ,

 

I have the following scenario. We use infinispan cache and mysql database to store our data.We use atomikos transaction manager to manage JTA Xa transatcions. When i do profiling i see teh following scenario for my usecase.

 

I have a business use ucase in which i have multiple cache reads and a single database and cache write.

 

So in teh prepare phase how will teh transactiosn give intruction to participating resources.

 

1 .I see that each of the cache , irrespective of read or write is registerd as participant . Is this expected ? (we use repetable_read as isolation level)

 

So there are multiple prepare calls for each cache read.

 

2.  Also i observe that when i do teh second operation (within the same call trace) , atomikos doesnt regiter this as a participant. So there is only one prepare call (if i do teh same operation twice)

 

3. So does it mean a prepare call will be sent once per combination fo cache and cache key ? [That is if i do 5 operation, 3 operation on teh cache c1 but different keys , and two operation on cache c2 and same key, totally there will be 4 prepare calls and 4 commit calls as aprt of xa]

 

 

Since i am aware that most of the operations i perform are cache reads with few databse writes is there any optimization i can do to avoid these calls ? [Also are these calls nececessary because i am using REPEATABLE:_READS]