Eduardo
Eduardo

Reputation: 133

Where to start managing transactions in java SOA application

i'm starting to work with Services in Java, and i've been googleing for a while but i still have no clue when is need to handle transactions y several services, e.g. if creating a client uses 3 services, and the third service crash, how can i roll back the 2 previous services? any link, or explanation could help

Upvotes: 0

Views: 204

Answers (2)

Michael Borgwardt
Michael Borgwardt

Reputation: 346270

For this you need distributed transations, which is exactly what the Java Transaction API is for. Application servers like Spring or Java EE's EJB container support JTA and make it very easy to use via annotations or declarative configuration.

Upvotes: 0

Bozho
Bozho

Reputation: 597076

If a client needs to call multiple service methods transactionally, then you'd better create a facade class which executes the 3 operations, transactionally.

If the operations require user input in between - don't do it. Such long-running transactions are prime candidates for performance problems and deadlocks.

Upvotes: 1

Related Questions