Adapter for SAP 10.1 | webMethods Adapter for SAP Documentation | webMethods Adapter for SAP Installation and User’s Guide Documentation | Package Management | Using the Adapter in a Clustered Environment | About Clustering for Adapter for SAP | How Outbound RFCs Are Balanced
 
How Outbound RFCs Are Balanced
With regard to SAP logical unit of work (LUW) management, note the following additional restrictions.
Whenever it is necessary to maintain the user context in the SAP system, subsequent calls must be issued from the same Integration Server over the same RFC connection. This limits the use of clustering because an RFC connection cannot be put into the repository server. It is bound to be a single Integration Server.
The method to bind an Integration Server session to an RFC connection is to embed subsequent requests of a SAP LUW (for example, a change BAPI and a BAPI_TRANSACTION_COMMIT) in a bind/release block. The resulting service can then be clustered.
However, if you want to execute an SAP LUW that has several dependent requests in a row that cannot be embedded into one service, you must ensure that the same user context is always used.
You can start and finish your dependent request sequence by binding and releasing your session to your RFC connection using special services.
1. To bind your Integration Server session to an RFC connection, call the pub.sap.client:lockSession service before any series of requests that must have the same user context assigned at the SAP system host. For more information about this service, see pub.sap.client:lockSession.
2. To release your Integration Server session, make sure that the LUW is complete (all services have been called). Then call the pub.sap.client:releaseSession service. For more information about this service, see pub.sap.client:releaseSession.