What distribution to use in Spring?

I have two different processes (A and B), and A should start after B, B should not join transaction A, B should wait until A completes the commit.

What distribution should I use?

Now it looks like:

@Transactional
A()

and

@Transactional
B()

Now I am using defult @Transactional and it is not working properly. I think I should use SPREAD .

Hope this question is clear. Thanks in advance.

+4
source share
2 answers

B() , A(), A() REQUIRES_NEW . enter image description here

spring framework :

PROPAGATION_REQUIRES_NEW, PROPAGATION_REQUIRED, . , , , , .

+4

enter image description here

, REQUIRES_NEW. , (TX).

, : . JtaTransactionManager, javax.transaction.TransactionManager .

+2

Source: https://habr.com/ru/post/1605742/


All Articles