posted 13 years ago
Hebert,
BMT method to CMT method behaves differenly based on TransactionAttributes used,
Required-->bean transaction will be carried over to CMT managed method since transactional context is available, if not, it will create newly
RequiredNew--> always create new transaction. So, here BMT is suspended and cannot keep the track of "RequiredNew" method
Mandatory--> same as "Required" scenario...if no transactional context i.e., calling this type method without no transaction in line, exception will be thrown
Likewise, it varies for Supported, NotSupported and Never
In turn, CMT to BMT,
CM Transaction will be suspended and BMT method will be invoked without any transactional context. So, BM transactions will be within the business logic code boundary...
So, committed BM Transaction cannot be rolled back when doing Rollback of CMT since CMT does not have the trace of transactions made in BMT managed method.
SCJP 6 [SCJP - Old is Gold]