3 Replies Latest reply: Dec 14, 2012 4:41 AM by sjensen RSS

    Tuxedo call fails - Gives tperrno-12 as error

    Raguraman
      Hi,

      I am into migration of a desktop applciation to web application using ADF. In my application I perform Tuxedo call through WTC using . I have a tuxedo service that takes more time to give reply (around 2 minutes). When I try to do this service call through WTC, it gives me TPException with tperrno as 12 (TPED_INVALIDCONTEXT). Code i use to perform tuxedo call is given below
          public TypedFML32 callTuxedo(String pServiceName, TypedFML32 pRequestBuffer)
          {
              TypedFML32 tuxReplyFML32 = null;
              TuxedoConnection tuxConn = null;
              Reply tuxReplyBuffer = null;
              try
              {
                  tuxConn = TuxedoServiceLocator.getLocator().getTuxedoConnection();
                  System.err.println("TP Call start time " + new Date());
                  tuxReplyBuffer = tuxConn.tpcall(pServiceName, pRequestBuffer, 0);
              }
              catch (TPReplyException tre)
              {
                  System.err.println("TP Call End time " + new Date());
                  // tpCall is done but it throws application validation error. Show error message to user.
              }
              catch (TPException tpee)
              {
                  // Tuxedo call failed due to connectivity issue.
                  int tperrNo = tpee.gettperrno();
                  System.err.println("TO Error " + tperrNo);
      
              }
              finally
              {
                  // Closing the association with Tuxedo
                  if (tuxConn != null && !tuxConn.isTerminated())
                  {
                      tuxConn.tpterm();
                  }
              }
              //Convert to typed FML 32 buffer
              tuxReplyFML32 = (TypedFML32) tuxReplyBuffer.getReplyBuffer();
              return tuxReplyFML32;
          }
      In the Weblogic server, I've set the Connection Policy of local access point as 'ON STARTUP' and remote access point as 'ON DEMAND'.

      Questions:

      1. I want to know whether my tuxedo call implmentation is correct.
      2. What makes my tuxedo call to return tperrno 12 and how can I resolve this. (In the older desktop application this service call takes nearly 2 minutes but works)

      Your timely help would be appreciated. Thanks.

      Raghu
        • 2. Re: Tuxedo call fails - Gives tperrno-12 as error
          sjensen
          First of all, I believe tperrno 12 means TPESYSTEM - and not TPED_INVALIDCONTEXT....

          I have no experience with WTC - only "pure" ATMI calls from C

          But....

          Your code contains:
          try
          {
          tuxConn = TuxedoServiceLocator.getLocator().getTuxedoConnection();
          System.err.println("TP Call start time " + new Date());
          tuxReplyBuffer = tuxConn.tpcall(pServiceName, pRequestBuffer, 0);
          }

          E.g. you have two tuxedo calls within the same try block - Both getTuxedoConnection() and tpcall() can throw exceptions -

          Do you now for sure - which call actually throws the exception ?


          Another problem i see with the overall structure of your code is - that you actually returns the "result" - Even when the tuxedo service call fails... E.g even when an exception occurs, you
          do
          //Convert to typed FML 32 buffer
          tuxReplyFML32 = (TypedFML32) tuxReplyBuffer.getReplyBuffer();
          return tuxReplyFML32;

          Think you have to elaborate a little on the structure.
          And to solve the problem with your error, we need some clarification of where ther error occurs.


          Another point is that if the tuxedo service call takes more than 2 minuttes - you should consider timeout situations. This should be covered within your configuration.
          • 3. Re: Tuxedo call fails - Gives tperrno-12 as error
            sjensen
            Also you should look at the ulog files - they might contain some details as to what the error is