<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Error and warning messages must have a
unique code that can be used to identify them
(<a class="moz-txt-link-freetext" href="https://issues.jboss.org/browse/ANDIAMO-7">https://issues.jboss.org/browse/ANDIAMO-7</a>) so JBAS014163 will
always refer to that error. The only thing you would need to be
careful of is if a more specific code were created and that was
generated instead. But you should be able to catch that in your
integration tests.<br>
<br>
Mike<br>
<br>
</div>
<blockquote cite="mid:51F25F78.9030608@redhat.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
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 moz-do-not-send="true"
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 moz-do-not-send="true"
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>
GytisOn 26/07/13 12:37, Gytis Trikleris wrote:<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 moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>
<br>
<a moz-do-not-send="true" 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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
wildfly-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/wildfly-dev">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>