A method that opens a transaction calls another method that starts a new transaction,if all connections are exhausted before the last new transaction method is executed,then all threads in the process will block,this process will fail.
Pseudo code:
@Transactional
methodA(){
// All the threads that started the transaction were executed here, but the connection was exhausted.
// The latter method execution will get a new connection,but it will never get it.
@Transactional(propagation=Propagation.REQUIRES_NEW)
methodB(){
}
}
A method that opens a transaction calls another method that starts a new transaction,if all connections are exhausted before the last new transaction method is executed,then all threads in the process will block,this process will fail.
Pseudo code: