4 Replies Latest reply on Jun 19, 2018 8:09 AM by Mallikarjun Chougule-Oracle

    Unusual behavior of tpacall in client application

    2668757

      Hi all:

       

      I have the following client application compiled with tuxedo buildclient command:

       

      .

      .

      .

      if (tpinit((TPINIT *) NULL) == -1)

      {

           printf("tperrno[%d]: %s\n", tperrno, tpstrerror(tperrno));

           exit(1);

      }

      .

      .

      .

      fmlOut = (FBFR32 *)tpalloc("FML32", NULL, 4096);

      fmlIn =  (FBFR32 *)tpalloc("FML32", NULL, 1024);

      .

      .

       

      Fadd32(fmlOut, TRF_ITF, (char *)&itf, 0);

      Fadd32(fmlOut, TRF_TRACE, (char *)&trace, 0);

      .

      .

      .

      if (tpbegin(timeoutTrx,0) == -1)

      {

           printf("Error: No se puede realizar el tpbegin\n");

           printf("tperrno[%d]: %s\n", tperrno, tpstrerror(tperrno));

           tpterm();

           return 0;

      }

       

      if ((svcDescriptor = tpacall("TrfAhTrfAhOC", (char *)fmlOut, 0L, 0)) == -1)

      {

           printf("tperrno[%d]: %s\n", tperrno, tpstrerror(tperrno));

           tpfree((char *)fmlOut);

           tpfree((char *)fmlIn);

           tpabort(0L);

           return 0;

      }

      gettimeofday(&tv, (struct timezone *)NULL);

      segs = 0;

      do

      {

           sts = tpgetrply(&svcDescriptor, (char **)&fmlIn, &lne, TPNOBLOCK);

           if (sts == -1)

           {

                switch (tperrno)

                {

                     case TPEBLOCK:

                          break;

                     case TPESVCFAIL:

                          tpfree((char *)fmlOut);

                          tpfree((char *)fmlIn);

                          tpabort(0L);

                          return 0;

                     break;

                     default:

                          printf("tperrno = [%d] - %s\n", tperrno, tpstrerror(tperrno));

                          if ((tperrno != TPESVCFAIL) && ((sts = tpabort(0)) == -1) )

                          printf("tpabort(1): tperrno[%d]: %s\n", tperrno, tpstrerror(tperrno));

                          tpfree((char *)fmlOut);

                          tpfree((char *)fmlIn);

                          return 0;

                     break;

                }

           }

           gettimeofday(&tv2, (struct timezone *)NULL);

           do

           {

                gettimeofday(&tv3, (struct timezone *)NULL);

                delay=(tv3.tv_sec - tv2.tv_sec)*1000000 + (tv3.tv_usec - tv2.tv_usec);

           }while (delay <= MSLEEP);

       

           gettimeofday(&tv1, (struct timezone *)NULL);

           segs=(tv1.tv_sec - tv.tv_sec)*1000000 + (tv1.tv_usec - tv.tv_usec);

      } while ((sts == -1) && (segs < (timeoutTrx*1000000)));

      if (segs >= (timeoutTrx*1000000))

      {

           if ((sts = tpabort(0)) == -1)

           printf("tpabort(2): tperrno[%d]: %s\n", tperrno, tpstrerror(tperrno));

           tpfree((char *)fmlOut);

           tpfree((char *)fmlIn);

           return 0;

      }

       

       

      Fget32(fmlIn, TRF_AUTORIZATION_RESPONSE, 0, (char *)&codAuth, 0);

       

      tpfree((char *)fmlOut);

      tpfree((char *)fmlIn);

      .

      .

      .

      if (tpcommit(0L) == -1)

      {

           printf("tperrno[%d]: %s\n", tperrno, tpstrerror(tperrno));

      }

       

       

      return 0;

       

       

      The application works fine for the first time, but the sucesives fails.

      The error was:

      tperrno[6]: TPENOENT - no entry found when try to invoke a service in :

      if ((svcDescriptor = tpacall("TrfAhTrfAhOC", (char *)fmlOut, 0L, 0)) == -1)

        • 1. Re: Unusual behavior of tpacall in client application
          user9130018

          Do you have access to the tuxedo domain and ulog file? can you check if server that advertises service with beautiful name "TrfAhTrfAhOC" crashed? Or maybe you are not connecting directly to the domain with TrfAhTrfAhOC service and the call is routed to one of two other domains (and one of them is not configured properly)?

          • 2. Re: Unusual behavior of tpacall in client application
            2668757

            thanks for your answer; the service is working fine i can monitor with tmadmin.

            There is an intermitense response. For 20 transactions , there was 12 good and 8 brings error with TPENOENT.

            I do not understand why this behavior

            • 3. Re: Unusual behavior of tpacall in client application
              user9130018

              perhaps tracing will help you:

               

              export TMTRACE=*:ulog:dye

               

              run your client app and paste ULOG file

              • 4. Re: Unusual behavior of tpacall in client application
                Mallikarjun Chougule-Oracle

                Hi 2668757,

                 

                 

                The error TPENOENT is Tuxedo "tperrno" error indicates that the calling process (i.e. your Tuxedo client program) is referencing a service that is not known to the system since there is no entry for it in the bulletin board.

                i.e. service "TrfAhTrfAhOC" not available.

                 

                What happens to Tuxedo server which offering Tuxedo service "TrfAhTrfAhOC" after tpacall()? Does it still available after tpacall() or dies after executing tpacall()?

                If server offering Tuxedo service "TrfAhTrfAhOC" dies then it will get booted again if you have configured it with RESTART=Y and some of later tpacall() to service can be successful.

                 

                As mentioned you can turn on Tuxedo TMTRACE on server side to get more details

                To enable Tuxedo TMTRACE ::

                 

                 

                1. During application boot time:

                       $ export TMTRACE=atmi+iatmi+xa:ulog:dye

                 

                 

                2. During run time using tmadmin command:

                   >chtr -m <Machine_Name> atmi+iatmi+xa:ulog:dye

                   >chtr off    #To turn off trace

                 

                 

                Get Tuxedo TMTRACE enabled ULOG extract from server side and paste for both successful and unsuccessful tpacall().   

                Curious to know that, what are your Tuxedo version+ RP<Patch level> details on client side and server side?

                  

                HTH,

                Best Regards,

                Mallikarjun