<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I have a bridge which creates JTA transaction if REST-AT transaction
context is available during REST request. Therefore, JAX-RS
resources can use @TransactionAttribute annotations. Example of such
resource is here: <a href="http://tinyurl.com/pf6c7hu">http://tinyurl.com/pf6c7hu</a>.<br>
<br>
If REST-AT transaction does not exist during the request to
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
transactionAttributeMandatory() - EJBTransactionRequiredException is
thrown. <br>
<br>
If REST-AT transaction does exist during the request to
transactionAttributeNever() - EJBException with the follwing message
is thrown: "JBAS014163: Transaction present on server in Never call
(EJB3 13.6.2.6)".<br>
<br>
To handle those exceptions I have an ExceptionMapper which returns
appropriate HTTP responses: <a href="http://tinyurl.com/q4v54ph">http://tinyurl.com/q4v54ph</a>.
In the mapper I can easily look for EJBTransactionRequiredException.
But in case of EJBException I am looking for JBAS014163 code. I
wanted to ask if it is safe to rely on looking for error code? Or
maybe there is a better option? <br>
<br>
Thanks,<br>
Gytis<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<div class="moz-cite-prefix">On 26/07/13 14:08, Scott Marlow wrote:<br>
</div>
<blockquote cite="mid:51F258A3.4030604@redhat.com" type="cite">Can
you give more context here, the full exception call stack would be
helpful (please post a pastebin.com link or something like that).
<br>
<br>
On 07/26/2013 06:10 AM, Gytis Trikleris wrote:
<br>
<blockquote type="cite">Hello,
<br>
<br>
I need to handle exception when either
<br>
TransactionAttributeType.MANDATORY or
TransactionAttributeType.NEVER
<br>
requirement is not met. It is not a problem for MANDATORY,
because
<br>
EJBTransactionRequiredException is thrown. However, general
EJBException
<br>
exception is thrown if unexpected transaction was on the thread.
<br>
<br>
I wanted to ask what is the best way to detect that EJBException
was
<br>
caused because of unnecessary transaction? Error code given by
the
<br>
exception is JBAS014163, but I am not sure if it is safe to rely
on
<br>
message codes...
<br>
<br>
Thanks,
<br>
Gytis
<br>
_______________________________________________
<br>
wildfly-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/wildfly-dev">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>