[seam-issues] [JBoss JIRA] (SEAMTRANSACTION-6) Check the AS7 JNDI non-EE location for the UserTransaction if it is not found

yangju (Commented) (JIRA) jira-events at lists.jboss.org
Sat Oct 29 15:17:45 EDT 2011


    [ https://issues.jboss.org/browse/SEAMTRANSACTION-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638422#comment-12638422 ] 

yangju commented on SEAMTRANSACTION-6:
--------------------------------------

Please note that in AS7, if jndi lookup cannot find an object, it will throw NamingException, not NameNotFoundException. The current DefaultSeamTransaction  does this:

try {
            return (javax.transaction.UserTransaction) context.lookup("java:comp/UserTransaction");
        } catch (NameNotFoundException nnfe) {
            try {
                // Embedded JBoss has no java:comp/UserTransaction
                javax.transaction.UserTransaction ut = (javax.transaction.UserTransaction) context.lookup("UserTransaction");
                ut.getStatus(); // for glassfish, which can return an unusable UT
                return ut;
            } catch (Exception e) {
                throw nnfe;
            }
        }

Instead, both NameNotFoundException  and NamingException should be caught and then try java:jboss/UserTransaction.
                
> Check the AS7 JNDI non-EE location for the UserTransaction if it is not found
> -----------------------------------------------------------------------------
>
>                 Key: SEAMTRANSACTION-6
>                 URL: https://issues.jboss.org/browse/SEAMTRANSACTION-6
>             Project: Seam Transaction
>          Issue Type: Enhancement
>    Affects Versions: 3.1.0.Beta4
>            Reporter: Jason Porter
>            Assignee: Stuart Douglas
>
> DefaultSeamTransaction should check java:jboss/UserTransaction if comp/UserTransaction is not found.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list