SAP adapter hangs in certain situations when using the explicit commit feature with high request rate.

SAP adapter hangs in certain situations when using the explicit commit feature with high request rate.

book

Article ID: KB0090225

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for SAP Solutions -
Not Applicable -

Description

Description:
The SAP adapter hangs in certain situations when using the explicit commit feature with high request rate.

Symptoms:
========
For an adr3 adapter service configured for Explicit Commit feature, COMMIT request is expected to follow the BAPI invocation. If the second request comes before the COMMIT of the first request has been processed, the adapter loses context of the first request resulting in an "Invalid Session ID" error.  This problem is seen when requests are sent at very high rate for BAPIs/RFCs which require separate commit for updating the data in the database.

Impact:
======
Data Loss:
The message for which the context is lost is not committed to the database. Hence, the data is lost.

Workarounds:
==========

Work Around 1:
Configure the adapter to use additional thread (the number of threads is dependent on the messaging rate of BAPI which requires the Explicit Commit.  When additional threads are used, the first request can be committed using the same thread, because the  additional threads process the additional requests.

Work Around 2:
Use a custom BAPI, which will remove the two-stage commit entirely. The custom BAPI should be designed such that it will call the BAPI followed by a commit. By this approach, the commit issue would be removed at source itself.

Cause :
=====
The issue occurs because when requests are sent at very high rate for a BAPI which requires explicit commit, the request for the COMMIT BAPI does not reach the SAP server after the request for BAPI which requires commit. Instead of the request for the commit BAPI which can commit the data sent earlier, request for the next BAPI requiring explicit commit reaches SAP and as a result of this context for the earlier transaction is lost. As a result of this loss of context, the COMMIT BAPI can no longer commit the data and data is lost.

For example, if you want to create sales order in your SAP system, you have the BAPI called BAPI_SALESORDER_CREATEFROMDAT1 which requires explicit commit for the data to be updated. The BAPI, which actually commits the data to database, is BAPI_TRANSACTION_COMMIT.
Suppose requests for BAPI_SALESORDER_CREATEFROMDAT1 are sent at very high rate. When the first request for BAPI_SALESORDER_CREATEFROMDAT1 is sent the next request which should reach SAP system is the request for  BAPI_TRANSACTION_COMMIT for committing the data ( sales order in this case) to database. But under this scenario ( very high messaging rate), second request for BAPI_SALESORDER_CREATEFROMDAT1 reaches the SAP system before the commit request for the fist one. As a result context is lost.

Resolution:
========
This issue is currently under investigation
Symptoms:

Cause:

Issue/Introduction

SAP adapter hangs in certain situations when using the explicit commit feature with high request rate.