The
AmbariJpaLocalTxnInterceptor
is used to intercept method calls
annotated with the
Transactional
annotation. If a transaction is not
already in progress, then a new transaction is automatically started.
Otherwise, the currently active transaction will be reused.
This interceptor also works with
TransactionalLock
s to lock on
TransactionalLock.LockArea
s. If this interceptor encounters a
TransactionalLock
it will acquire the lock and then add the
TransactionalLock.LockArea
to a collection of
areas which need to be released when the transaction is committed or rolled
back. This ensures that transactional methods invoke from an already running
transaction can have their lock invoked for the lifespan of the outer
"parent" transaction.