java - Need clarification regarding Transaction attribute -


i have read transactionattributetype.required that

if client running within transaction , invokes enterprise bean’s method, method executes within client’s transaction. if client not associated transaction, container starts new transaction before running method.

the client ejb application deployed on server a, , invokes method methodb of bean deployed on server b within transaction. if methodb has transactionattributetype.required, it'll run under same transaction started client application. right?

if yes, how application deployed on different server know transaction started on server?

if no, how methodb use same transaction?

i new ejb please go easy on me. pointer right direction highly appreciated.

if client on server has started transaction, transaction context propagated bean annotated transactionattributetype.required. it's part of invocation.

so answer first question yes: methodb in server b, called ejb application on server a, runs in same transaction. final commit or rollback controlled client running on server a.

the client on server may enlist other xa resources in same transaction well: example, writes xa data source , sends message using xa jms. commit on transaction persists changes caused methodb, write row database, , message in queue. if client rollback, units of work rolled (and nothing has changed).

related: two-phase commit protocol (wikipedia)


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -