1 Reply Latest reply on Sep 6, 2012 3:44 PM by Steven Hawkins

    Exception Handling with Teiid

    tanmoypalit Newbie

      Hi Guys,

       

      Is there anyway to handle exceptions or error messages return by SOAP or REST service invoked by a Teiid Virtual procedure?

       

       

      CREATE VIRTUAL PROCEDURE

      BEGIN

                DECLARE string VARIABLES.INPUT_ENDPOINT;

                VARIABLES.INPUT_ENDPOINT = ServiceManagerServiceView.getDataReport.soapstring;

                SELECT DataHeader.* FROM (EXEC ServiceManagerService.invoke(binding => 'SOAP11', action => '', request => XMLPARSE(DOCUMENT VARIABLES.INPUT_ENDPOINT))) AS ws, XMLTABLE('/*:getHeaderResponse/return/response/report/record' PASSING ws.result COLUMNS ATTRIBUTES XML PATH 'attribute') AS DataHeader;

      END

      Suppose ServiceManagerService.invoke returns error or exception or no data, what would be the best way of handling the error or exception or no data?

       

      P.S

      I publish teiid data as REST service and currently it throws an unhandled excpetion in case ServiceManagerService.invoke returns error or exception or no data.

       

      Thanks for the help!

       

      Regards

      Tanmoy Palit

        • 1. Re: Exception Handling with Teiid
          Steven Hawkins Master

          Until https://issues.jboss.org/browse/TEIID-1386 is worked exceptions are not handled well in our procedure language.  The two current approaches are to take steps prior to you action to avoid an exceptional condition, for example selecting to see if a row exists before inserting.  The other is to handle the exceptional case in your application layer calling Teiid.  You can of course add customized handling at the translator layer as well, but that's not a great solution most of the time.

           

          With TEIID-1386 we'll add appropriate exception handling logic to our block syntax.

           

          Steve