Derby
  1. Derby
  2. DERBY-5553

System property for client tracing -Dderby.client.traceDirectory does not work with XADataSource

    Details

    • Urgency:
      Normal
    • Issue & fix info:
      High Value Fix, Newcomer, Patch Available

      Description

      The client system property -Dderby.client.traceDirectory does not work with ClientXADataSource. No trace files are created if this property is set when making XA Connections.

      I am sure it works fine with DriverManager connections and also checked tracing works fine using connection attributes and XA with. ds.setConnectionAttributes("traceDirectory=./traceDir");

      I have not checked ClientDataSource or ClientConnectionPoolDataSource.

      Attached is a reproduction for this issue.
      mkdir ./traceDir

      javac -g XATemplate.java utilXid.java
      java -Dderby.client.traceDirectory="./traceDir" XATemplate

      You will see that traceDir is empty.
      This came up when debugging DERBY-5552

      1. XATemplate.java
        3 kB
        Kathey Marsden
      2. utilXid.java
        2 kB
        Kathey Marsden
      3. derby-5553_diff_withtests.txt
        5 kB
        Kathey Marsden
      4. derby-5553_codediff.txt
        2 kB
        Kathey Marsden

        Issue Links

          Activity

          Hide
          Myrna van Lunteren added a comment -

          bulk change to close all issues resolved but not closed and not changed since June 1, 2014.

          Show
          Myrna van Lunteren added a comment - bulk change to close all issues resolved but not closed and not changed since June 1, 2014.
          Hide
          Kathey Marsden added a comment -

          Marking derby_backport_reject_10_19 as the client datasource structure is different on earlier branches and this would be a manual merge. The fix could be manually backported if specifically required on an earlier branch.

          Show
          Kathey Marsden added a comment - Marking derby_backport_reject_10_19 as the client datasource structure is different on earlier branches and this would be a manual merge. The fix could be manually backported if specifically required on an earlier branch.
          Hide
          ASF subversion and git services added a comment -

          Commit 1519123 from Kathey Marsden in branch 'code/branches/10.10'
          [ https://svn.apache.org/r1519123 ]

          DERBY-5553 System property for client tracing -Dderby.client.traceDirectory does not work with XADataSource

          merge revision 1518766 from trunk.

          Show
          ASF subversion and git services added a comment - Commit 1519123 from Kathey Marsden in branch 'code/branches/10.10' [ https://svn.apache.org/r1519123 ] DERBY-5553 System property for client tracing -Dderby.client.traceDirectory does not work with XADataSource merge revision 1518766 from trunk.
          Hide
          ASF subversion and git services added a comment -

          Commit 1518766 from Kathey Marsden in branch 'code/trunk'
          [ https://svn.apache.org/r1518766 ]

          DERBY-5553 System property for client tracing -Dderby.client.traceDirectory does not work with XADataSource

          Show
          ASF subversion and git services added a comment - Commit 1518766 from Kathey Marsden in branch 'code/trunk' [ https://svn.apache.org/r1518766 ] DERBY-5553 System property for client tracing -Dderby.client.traceDirectory does not work with XADataSource
          Hide
          Knut Anders Hatlen added a comment -

          The fix and the test cases look good to me. You may want to change the comment in updateDataSourceValues() so that it describes what the code does instead of the symptoms of the fixed bug. For example something along these lines:

          // Trace level and trace directory will be read from system
          // properties if they are not specified in the Properties
          // argument, so we check for them first to avoid getting cut
          // off by the (prop == null) check below.

          Show
          Knut Anders Hatlen added a comment - The fix and the test cases look good to me. You may want to change the comment in updateDataSourceValues() so that it describes what the code does instead of the symptoms of the fixed bug. For example something along these lines: // Trace level and trace directory will be read from system // properties if they are not specified in the Properties // argument, so we check for them first to avoid getting cut // off by the (prop == null) check below.
          Hide
          Kathey Marsden added a comment -

          Tests passed. Marking patch available. Ready for review.

          Show
          Kathey Marsden added a comment - Tests passed. Marking patch available. Ready for review.
          Hide
          Kathey Marsden added a comment -

          Attached is an updated patch derby-5553_diff_withtests.txt which adds tests to ClientSideSystemPropertiesTest for the DataSources. Also fixes a couple bugs with the initial patch which might have caused NPE's and corrected the default traceLevel if no traceLevel is set. Running tests.

          Show
          Kathey Marsden added a comment - Attached is an updated patch derby-5553_diff_withtests.txt which adds tests to ClientSideSystemPropertiesTest for the DataSources. Also fixes a couple bugs with the initial patch which might have caused NPE's and corrected the default traceLevel if no traceLevel is set. Running tests.
          Hide
          Kathey Marsden added a comment -

          Here is a patch for the code changes for this issue. DataSources were looking only at the attributes and not system properties. I tested the change with the reproduction and also with ConnectionPoolDataSource. I will look at writing tests. I don't think we have existing tests for testing the tracing system properties.

          Show
          Kathey Marsden added a comment - Here is a patch for the code changes for this issue. DataSources were looking only at the attributes and not system properties. I tested the change with the reproduction and also with ConnectionPoolDataSource. I will look at writing tests. I don't think we have existing tests for testing the tracing system properties.
          Hide
          Kathey Marsden added a comment -

          Triage for 10.9. Marking Newcomer and High Value Fix as it should be straight forward and as Brett discovered, it can be quite frustrating when diagnosing a problem to find the diagnostics don't work.

          Show
          Kathey Marsden added a comment - Triage for 10.9. Marking Newcomer and High Value Fix as it should be straight forward and as Brett discovered, it can be quite frustrating when diagnosing a problem to find the diagnostics don't work.
          Hide
          Kathey Marsden added a comment -

          Attaching reproduction. See description for run instructions.

          Show
          Kathey Marsden added a comment - Attaching reproduction. See description for run instructions.
          Hide
          Kathey Marsden added a comment -

          Linking to DERBY-5552 as this issue came up when debugging that one.

          Show
          Kathey Marsden added a comment - Linking to DERBY-5552 as this issue came up when debugging that one.

            People

            • Assignee:
              Kathey Marsden
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development