Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-530

Thrown Exceptions often loose the original cause

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate Issue
    • Affects Version/s: 4.5.0
    • Fix Version/s: None
    • Component/s: Transaction Core
    • Labels:
      None

      Description

      In JBossTM exceptions are often catched and left behind in favor of a new dedicated Exception (or Error) contextually thrown.
      This lead to a steady lack of information about the origin of the final symptom.

      As an example, see the following code snippet (extracted from com.arjuna.ats.internal.arjuna.objectstore.JDBCStore.JDBCStore())
      ...
      try

      { initialise(""); }

      catch (Exception e)

      { throw new ObjectStoreError(); }

      ...

      Here the original exception "e" is lost in favor of a new ObjectStoreError. No one will never know the cause of the thrown ObjectStoreError, nor see what's wrong without using a debugger (if ever available).

      Since I saw the binary distribution of JBossTM (at least version 4.5.0) is compiled for Java 1.5, I suppose you aren't denied to use the standard exception chaining mechanism introduced since Java 1.4 (namely the java.lang.Throwable.cause field)

      Please consider refactoring your code to chain the exception causes. It would be very useful.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  davidecavestro Davide Cavestro
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: