[infinispan-dev] Async API

Radim Vansa rvansa at redhat.com
Thu Oct 27 11:00:36 EDT 2016


On 10/27/2016 10:49 AM, Jonathan Halliday wrote:
> On 27/10/16 09:36, Radim Vansa wrote:
>
>> So it's probably a question to Narayana guys if you can suspend a
>> transaction in one thread and resume it in two threads.
> yes you can.  Where it gets hairy is ensuring all the threads are done
> before you commit. By default we warn rather than block, though there is
> a (non-standard) plugin api to register your own handler for it.

Warn/block what exactly? Any thread could commit the tx, and it commits 
that for all threads - I understand that it can be complex on the user 
side, but how can TM know that there's a thread that's still working on 
the transaction (do you expect that all other threads than the 
committing one will suspend the transaction when these are done?).

Btw., is there any API to just fork the tx? (rather than suspending and 
resuming) Can you just resume a non-suspended transaction acquired by 
tm.getTransaction() in another thread?

Thanks!

Radim

>
> Jonathan.
>
>


-- 
Radim Vansa <rvansa at redhat.com>
JBoss Performance Team



More information about the infinispan-dev mailing list