<s>
The	O
Jakarta	B-Language
Transactions	I-Language
(	O
JTA	O
;	O
formerly	O
Java	B-Language
Transaction	I-Language
API	I-Language
)	O
,	O
one	O
of	O
the	O
Jakarta	B-Language
EE	I-Language
APIs	B-Application
,	O
enables	O
distributed	B-General_Concept
transactions	I-General_Concept
to	O
be	O
done	O
across	O
multiple	O
X/Open	O
XA	O
resources	O
in	O
a	O
Java	B-Language
environment	O
.	O
</s>
<s>
JTA	O
was	O
a	O
specification	O
developed	O
under	O
the	O
Java	B-Language
Community	I-Language
Process	I-Language
as	O
JSR	B-Language
907	I-Language
.	O
</s>
<s>
X/Open	O
XA	O
API	B-Application
allowing	O
resources	O
to	O
participate	O
in	O
transactions	O
.	O
</s>
<s>
In	O
the	O
X/Open	O
XA	O
architecture	O
,	O
a	O
transaction	B-General_Concept
manager	I-General_Concept
or	O
transaction	B-General_Concept
processing	I-General_Concept
monitor	I-General_Concept
(	O
TP	O
monitor	O
)	O
coordinates	O
the	O
transactions	O
across	O
multiple	O
resources	O
such	O
as	O
databases	O
and	O
message	O
queues	O
.	O
</s>
<s>
The	O
resource	O
manager	O
typically	O
has	O
its	O
own	O
API	B-Application
for	O
manipulating	O
the	O
resource	O
,	O
for	O
example	O
the	O
JDBC	B-Language
API	B-Application
to	O
work	O
with	O
relational	O
databases	O
.	O
</s>
<s>
In	O
addition	O
,	O
the	O
resource	O
manager	O
allows	O
a	O
TP	O
monitor	O
to	O
coordinate	O
a	O
distributed	B-General_Concept
transaction	I-General_Concept
between	O
its	O
own	O
and	O
other	O
resource	O
managers	O
.	O
</s>
<s>
Finally	O
,	O
there	O
is	O
the	O
application	O
which	O
communicates	O
with	O
the	O
TP	O
monitor	O
to	O
begin	O
,	O
commit	B-Language
or	O
roll	B-Application
back	I-Application
the	O
transactions	O
.	O
</s>
<s>
The	O
application	O
also	O
communicates	O
with	O
the	O
individual	O
resources	O
using	O
their	O
own	O
API	B-Application
to	O
modify	O
the	O
resource	O
.	O
</s>
<s>
The	O
JTA	O
API	B-Application
consists	O
of	O
classes	O
in	O
two	O
Java	B-Language
packages	I-Language
:	O
</s>
<s>
The	O
JTA	O
is	O
modelled	O
on	O
the	O
X/Open	O
XA	O
architecture	O
,	O
but	O
it	O
defines	O
two	O
different	O
APIs	B-Application
for	O
demarcating	O
transaction	O
boundaries	O
.	O
</s>
<s>
It	O
distinguishes	O
between	O
an	O
application	B-Application
server	I-Application
such	O
as	O
an	O
EJB	B-Language
server	O
and	O
an	O
application	O
component	O
.	O
</s>
<s>
It	O
provides	O
an	O
interface	O
,	O
,	O
that	O
is	O
used	O
by	O
the	O
application	B-Application
server	I-Application
itself	O
to	O
begin	O
,	O
commit	B-Language
and	O
roll	B-Application
back	I-Application
the	O
transactions	O
.	O
</s>
<s>
It	O
provides	O
a	O
different	O
interface	O
,	O
the	O
,	O
that	O
is	O
used	O
by	O
general	O
client	O
code	O
such	O
as	O
a	O
servlet	O
or	O
an	O
EJB	B-Language
to	O
manage	O
the	O
transactions	O
.	O
</s>
<s>
As	O
stated	O
previously	O
,	O
each	O
resource	O
will	O
have	O
its	O
own	O
specific	O
API	B-Application
,	O
for	O
instance	O
:	O
</s>
<s>
generalized	O
EIS	O
(	O
Enterprise	B-General_Concept
Information	I-General_Concept
System	I-General_Concept
)	O
resources	O
use	O
Java	B-Language
EE	I-Language
Connector	I-Language
API	I-Language
.	O
</s>
<s>
The	O
Jakarta	B-Language
Transactions	I-Language
API	B-Application
consists	O
of	O
three	O
elements	O
:	O
a	O
high-level	O
application	O
transaction	O
demarcation	O
interface	O
,	O
a	O
high-level	O
transaction	B-General_Concept
manager	I-General_Concept
interface	O
intended	O
for	O
an	O
application	B-Application
server	I-Application
,	O
and	O
a	O
standard	O
Java	B-Language
mapping	O
of	O
the	O
X/Open	O
XA	O
protocol	O
intended	O
for	O
a	O
transactional	O
resource	O
manager	O
.	O
</s>
<s>
by	O
Java	B-Language
client	O
programs	O
or	O
EJB	B-Language
beans	O
.	O
</s>
<s>
transparently	O
by	O
the	O
Transaction	B-General_Concept
Manager	I-General_Concept
.	O
</s>
<s>
underlying	O
transaction	B-General_Concept
manager	I-General_Concept
implementations	O
on	O
the	O
client	O
and	O
server	O
machines	O
.	O
</s>
<s>
The	O
available	O
options	O
closely	O
mirror	O
those	O
of	O
the	O
EJB	B-Language
specification	O
.	O
</s>
<s>
Jakarta	B-Language
Enterprise	I-Language
Beans	I-Language
Specification	O
.	O
</s>
<s>
Server	O
and	O
the	O
TM	O
is	O
transparent	O
to	O
the	O
application	O
;	O
the	O
burden	O
of	O
implementing	O
transaction	O
management	O
is	O
on	O
the	O
EJB	B-Language
container	I-Language
and	O
server	O
provider	O
.	O
)	O
</s>
<s>
The	O
code	O
sample	O
below	O
illustrates	O
the	O
usage	O
of	O
UserTransaction	O
via	O
bean-managed	O
transactions	O
in	O
an	O
EJB	B-Language
session	B-Language
bean	I-Language
:	O
</s>
<s>
Making	O
use	O
of	O
a	O
UserTransaction	O
is	O
thus	O
not	O
necessary	O
in	O
EJB	B-Language
programming	O
,	O
but	O
might	O
be	O
needed	O
for	O
very	O
specialized	O
code	O
.	O
</s>
<s>
The	O
UserTransaction	O
should	O
be	O
available	O
under	O
java:comp/UserTransaction	O
(	O
if	O
a	O
JTA	O
implementation	O
is	O
installed	O
in	O
the	O
environment	O
)	O
.	O
</s>
