forked from jbosstm/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
integrating_with_other_transaction_models.xml
88 lines (85 loc) · 3.59 KB
/
integrating_with_other_transaction_models.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "../project_documentation.ent">
%BOOK_ENTITIES;
]>
<section id="_interoperating_with_other_transaction_models">
<title>Interoperating With Other Transaction Models</title>
<para>
Narayana in general supports a number of different transaction models other than the one described in
this book. Of particular importance are the standard ones supported by the standards, namely JTA and Web
Services Transactions.
</para>
<section id="_jta_bridge">
<title>JTA Bridge</title>
<section id="_inbound_bridge">
<title>Inbound Bridge</title>
<para>
REST-AT to JTA bridge (also called inbound bridge) allows JTA resources to be enlisted in
REST-AT transaction. Therefore, tools such as JPA and JMS can be used by JAX-RS endpoints and their
XA resources will participate in the REST-AT transaction together with RESTful participants.
</para>
<para>
This functionality is provided by Wildfly RTS subsytem. Therefore, modular dependency on
org.jboss.narayana.rts has to be defined in deployment’s manifest file.
In order to enable bridging, service writer has to annotate either JAX-RS resource class or specific JAX-RS resource
method with one of two annotations: javax.ejb.TransactionAttribute, javax.transaction.Transactional.
</para>
<programlisting language="java" linenumbering="unnumbered">
@Path("/")
public class JAXRSResource {
@GET
public void get() {
// Do work witout JTA.
}
@POST
@TransactionAttribute
public void post() {
// Do work with JTA.
}
}
</programlisting>
<programlisting language="java" linenumbering="unnumbered">
@Path("/")
@Transactional
public class JAXRSResource {
@GET
public void get() {
// Do work with JTA.
}
@POST
public void post() {
// Do work with JTA.
}
}
</programlisting>
<para>
REST-AT transaction context does not provide timeout.
When REST-AT transaction is bridged to JTA then the bridged JTA transaction
is created with the default timeout defined by the container.
</para>
</section>
<section id="_outbound_bridge">
<title>Outbound Bridge</title>
<para>Enabling RESTAT participants to participate in a JTA transaction.</para>
<warning>
<para>Outbound bridging is not currently implemented</para>
</warning>
</section>
</section>
<section id="_web_services_transactions">
<title>Web Services Transactions</title>
<para>
WS includes two transaction models referred to as WSAT and WSBA. WSAT integration with JTA is documented
in the Transaction Bridging section of the product guide (
<ulink url="http://narayana.io/docs/product/index.html#txbridge">http://narayana.io/docs/product/index.html#txbridge</ulink>
). By using this bridge in conjunction with the RESTAT JTA bridge full interoperability between RESTAT
and WSAT can be realised.
</para>
<note>
<para>
RESTAT outbound bridging is not currently supported so interoperability is one way only.
</para>
</note>
</section>
</section>