10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

FIGURE 33–3 Updating Multiple Databases across <strong>Java</strong> <strong>EE</strong> Servers<br />

Client<br />

Databases<br />

Transactions inWeb Components<br />

<strong>Java</strong> <strong>EE</strong><br />

Server<br />

Bean-A<br />

Bean-B<br />

X Y<br />

Transactions inWeb Components<br />

<strong>Java</strong> <strong>EE</strong><br />

Server<br />

You can demarcate a transaction in a web component by using either the<br />

java.sql.Connection or javax.transaction.UserTransaction interface. <strong>The</strong>se are the same<br />

interfaces that a session bean with bean-managed transactions can use. Transactions<br />

demarcated with the UserTransaction interface are discussed in the section “JTA<br />

Transactions” on page 996. For an example of a web component using transactions, see<br />

“Accessing Databases” on page 107.<br />

Chapter 33 • Transactions 999

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!