Reputation: 1299
I found sth like this:
My questions are:
Upvotes: 0
Views: 267
Reputation: 19002
Answers:
Standalone means more things, like: you create by your own instances of EntityManager
(vs. they are not injected), you begin and commit by yourself transactions, you are responsible for propagating the transaction (which code (e.g of different services) gets executed in which transaction).
Transaction demarcation is the way you start, propagate and end the transaction. If you use a managed environment (with JTA), then you can annotate the service methods somehow and control how the "transaction is propagated" between different service calls. Say: with only annotations you can decide that on calling PersService.addPerson(Person person)
a transaction T1 automatically is begun, and that code executed in AddressService.saveAddress(Address address)
(called from addPerson()
) is executed in the same transaction T1 (or if you want, a new transaction T2). Also with JTA, different databases can do work within the same transaction.
Upvotes: 2