Error Handling

I am using the Webmethods SAP Business Connector Server verion 4.8. We have a very basic setup. We have an RFC call from SAP to the BC server that passes a SQL statement. The BC Server connects to an Oracle database and returns an Updatecount (for insert statements) or a Rowcount and results table for select statements. I used the standard delivered service execSQL to connect to the database. I am using the JDBC OCI driver provided by Oracle.

The problem is that if the DB passes an error back to the BC server, then the BC server does not forward that error on to SAP. Instead, SAP just gets a SYSTEM_FAILURE error with no details. It doesn’t matter what error.

For example: If I pass an insert statement and don’t provide a key field in the table, then Oracle passes an error message back to the BC Server. From SAP I just get a SYSTEM_FAILURE message with no details. From the BC Developer I get a popup window with a detailed error message from the Database. The service does not return anything.

It seems like the service shoule pass the database error back in the $dbMessage field. Instead, the service fails and exits the flow. Since the flow is lost there is no link back to SAP and SAP receives the SYSTEM_FAILURE message.

I have no custom code in the flow. Only the standard delivered service “execSQL” and a map to map the execSQL service to the RFC.

Does anybody have a suggestion on how to capture this error message without exiting the flow?

One more example. I execute a valid insert statement. No problems. Then I execute the exact same insert statement again. I would expect an error because this violate the unique record in the database table key rule.
-SAP would then recieve a SYSTEM_FAILURE from the BC Server.
-The BC Developer gets a pop-up window with the following error message: “java.sql.SQLException: ORA-00001: unique constraint (TSMGR.PKMVMS_TRANS) violated”. The flow exits and there are no results.

What I want is to not have the flow exit. Instead I want to pass the database error message back to the RFC.

I found something on my own. Inside of pachage WmSamples, folders sample-errorHandling-util there are several sample approaches. I followed the second approach theory.
Sequence -exit on success

Sequence - exit on failure

enter flow info I was using previously here with execSQL
Sequence - exit when done
getLastError service

It also gave me a good idea for status updates with commit and rollback flows.