4 Replies Latest reply on May 26, 2010 9:35 PM by 260010

    How to see fn:trace() results in log and/or Workshop console?

    260010
      Hello, all.
      I am a new in ODSI, so, in advance, my apologise for basic questions.

      I would like to use fn:trace() function. However, the following code does not send any information either to AdminServer.log or Wokshop console. What is the reason?

      declare procedure tns:test(){
      declare $timeBefore as xs:date := fn:current-date();
      fn:trace($timeBefore, "My first test"); --> How to see trace result?
      return value $timeBefore;
      };

      Here is what I have in AdminServer.log and Workshop console:

      common/application {
      user: weblogic
      name: testCase2
      eventkind: update
      server: AdminServer
      }

      query/performance {
      compiletime: 93
      }

      common/session/query/invocation {
      time: Tue May 25 15:41:12 IDT 2010
      duration: 0
      }

      update/service {
      procedure: test
      arity: 0
      dataservice: ld:Logical/over_files/testCase_OverFiles.ds
      script: declare namespace ns0="ld:Logical/over_files/testCase_OverFiles";
      { return value ns0:test(); }
      }

      common/time {
      timestamp: Tue May 25 15:41:12 IDT 2010
      duration: 93
      }

      Best regards,
      Yuri.

      Edited by: ygauchma on May 25, 2010 5:59 AM
        • 1. Re: How to see fn:trace() results in log and/or Workshop console?
          Mikereiche-Oracle
          Re: DSP - fn:trace not working / CodeChange FAQs


          <May 25, 2010 8:56:05 AM PDT> <Debug> <ODSI> <BEA-000000> <TestTrace> <My first
          test: [date 2010-05-25-07:00]>

          Note that in xquery functions (your example is a procedure), that functions (such as trace) are called only if they need to be called to product the result. Thus if you had something like


          for $c in CUSTOMER()
          trace($c/LAST_NAME)
          return
          $c

          There would be no output from trace.
          • 2. Re: How to see fn:trace() results in log and/or Workshop console?
            260010
            Hello, Mike.
            Thank you very much for your response.

            In the following example I am using the trace function when the integerToString() produces the result, but it also does not work, although the logging Level of the my dataspace is set to Debug.

            (::pragma function <f:function kind="library" visibility="public" isPrimary="false" xmlns:f="urn:annotations.ld.bea.com"/>::)

            *declare function tns:integerToString($arg00 as xs:positiveInteger) as xs:string{*
            trace(xs:string($arg00),"My First Trace")
            *};*



            [Wed May 26 22:54:52 IDT 2010] End
            ------------------------------------------------------------------------

            [Wed May 26 22:59:44 IDT 2010] Starting...

            Query compilation time: 78 ms
            Query evaluation time: 0 ms
            Operation duration: 78 ms

            Audit Event:

            common/application
            user: weblogic
            name: testCase2
            server: AdminServer
            eventkind: evaluation

            query/cache/queryplan
            found: false
            type: XQUERY_PLAN_CACHE

            query/cache/queryplan
            type: XQUERY_PLAN_CACHE
            inserted: true

            query/performance
            compiletime: 78

            query/performance
            evaltime: 0

            query/service
            function: integerToString
            arity: 1
            dataservice: ld:Logical/over_files/testCase_OverFiles.ds
            query:
            declare namespace ns0="ld:Logical/over_files/testCase_OverFiles";
            declare namespace ns1="http://www.w3.org/2001/XMLSchema";
            declare variable $__fparam0 as ns1:positiveInteger external;
            fn:subsequence(
            ns0:integerToString($__fparam0)
            , 1, 500)

            common/time
            duration: 78
            timestamp: Wed May 26 22:59:44 IDT 2010

            [Wed May 26 22:59:44 IDT 2010] End


            Can you recommend me any XQUERY and XQSE tutorials, because even http://www.xqueryfunctions.com/xq/fn_trace.html does not contain clear example.
            Best regards,
            Yuri.
            • 3. Re: How to see fn:trace() results in log and/or Workshop console?
              Mikereiche-Oracle
              Since I'm not looking over your shoulder, you need to be really clear about what you tried.

              Your first post you show a procedure using trace. Well, I tried that, plus the instructions (set ODSI log level to debug and WLS log level to debug) and it did work. Did you try that? Did it work?

              Now you are showing a function. Did you try setting the log levels?

              Where are you looking for the results? The will NOT be in the Console for ODSI Studio Test View (I assume that is where you are looking). They will be in the WLS log file if you configured WLS Log file -> Log Level=debug. They will be in the WLS console (stdout/stderr) if you configured that Log Level=debug.

              I believe the trace function is implementation specific, so there is no such thing as a generic example.

              - Mike
              • 4. Re: How to see fn:trace() results in log and/or Workshop console?
                260010
                Hello, Mike.
                Thanks a lot - it works both for procedures and functions. The problem was that I put Debug level for Dataspace only in ODSI. After setting Debug level in WLS everything works now.
                Best regards,
                Yuri.