on 2022 Jul 07 10:17 AM
Hi everyone,
we are working with custom SDI adapters and I was wondering if someone has found a solution for handling exceptions.
An example:
We have a stored procedure which runs an insert into a virtual table linked to sdi adapter.
begin
DECLARE EXIT HANDLER FOR SQLEXCEPTION
begin
Select ' SQL-ERROR:' || ::SQL_ERROR_MESSAGE from dummy;
end;
insert into "OUR_SCHEMA"."OUR_SDI_SALESFORCE_TABLE" values ('A','B','C');
end;
The insert command forwards the data to our SDI Adapter, we build a REST call and send this data to Salesforce.
If Salesforce somehow fails to process the REST call, Salesforce sends back an JSON Object containing a error message and we currently throw an exception in our SDI coding in order to tell Hana that something did not work as we expected.
We do this in the java code of the adapter like :
throw new AdapterException(1, "Bad... SF did not accept the insert");
On SPS 05 the exception was handle by the Exit Handler of the stored procedure and we were able to react on the exception by eg saving the failed record in a log for further processing.
On SPS 06 the stored procedure stops/breaks and instead of a processing of the exit handler the Hana SQL console shows the message
"remote source <the_remote_source_name> is unable to prepare transaction id ...".
Does someone knows a way to tell the stored procedure that something went wrong without breaking / abording the stored procedure ?
If someone wants to have a deeper look - the SDI is a great tool !
Kind regards
Andreas
Request clarification before answering.
I did not find a solution yet so I am now trying to avoid any exceptions since they will stop the further processing of my stored procedures on the hana side.
In order to get an hint/information that something failed, I implemented a ring buffer to store the error - messages from salesforce. This ring - buffer is propagated to hana as a SDI Table an stores in case of an error / exception the JSON Data send to Salesforce and the JSON Answer recieved from Salesforce.
Normally the JSON send to SF contains a ID or Key for Salesforce to identify the record which then allows us to identify the failed record.
JSON Reply can be parsed as a string using Hana regex or parsed as a JSON using a Hana Json Document Store.
If someone has a better idea please let Michael and me know.
Regards
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.