Uploaded image for project: 'Seam Transaction'
  1. Seam Transaction
  2. SEAMTRANSACTION-6

Check the AS7 JNDI non-EE location for the UserTransaction if it is not found

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.1.0.Beta4
    • Fix Version/s: 3.1.0.Beta5
    • Labels:
      None

      Description

      DefaultSeamTransaction should check java:jboss/UserTransaction if comp/UserTransaction is not found.

        Gliffy Diagrams

          Activity

          Hide
          yangju Richard Yang added a comment -

          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.

          Show
          yangju Richard Yang added a comment - 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.

            People

            • Assignee:
              lightguard Jason Porter
              Reporter:
              lightguard Jason Porter
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development