Does JTA work across multiple threads?
atomikos, distributed-transactions, jta, transactions, xa
Solution
you can use the TransactionManager's getTransaction() in the initial thread and resume() in the other thread to span the same transaction across multiple threads, or suspend() / resume() to move a transaction to another thread.
It depends on a particular transaction manager implementation if this feature is supported or not. There will be a good chance that this will be supported because such features are required when e.g. the same transaction needs to be passed across multiple beans (possibly running on different work manager), or even to span the transaction across multple VMs if the app server is running in a cluster (in this case, you will need to probably really dig into the particular transaction manager implementation or let the app server to do its home-work).
Problem
From JTA specs i understand that it works (or supports) distributed transactions only for calling thread. Does this mean that transactions cannot be spanned across multiple threads? Or it depends on implementation? Does any JTA implementation supports XA across threads? Thanks!