Function sapnwrfc::binding::RfcInstallTransactionHandlers [] [src]

pub unsafe extern "C" fn RfcInstallTransactionHandlers(
    sysId: *const SAP_UC,
    onCheckFunction: RFC_ON_CHECK_TRANSACTION,
    onCommitFunction: RFC_ON_COMMIT_TRANSACTION,
    onRollbackFunction: RFC_ON_ROLLBACK_TRANSACTION,
    onConfirmFunction: RFC_ON_CONFIRM_TRANSACTION,
    errorInfo: *mut RFC_ERROR_INFO
) -> RFC_RC

Installs the necessary callback functions for processing incoming tRFC/qRFC calls.

These functions need to be implemented by you and will be used by the RFC runtime in the following way: -# The RFC_ON_CHECK_TRANSACTION function is called when a local transaction is starting. Since a transactional RFC call can be issued many times by the client system, the function is responsible for storing the transaction ID in permanent storage. The return value should be one of the following: - RFC_OK\n Transaction ID stored, transaction can be started. - RFC_EXECUTED\n This transaction has already been processed successfully in an earlier attempt. Skip the execution now. - RFC_EXTERNAL_FAILURE\n Currently unable to access my permanent storage. Raise an exception in the sending system, so that the sending system will try to resend the transaction at a later time. -# The next step will be the execution of the RFC_SERVER_FUNCTIONs for all function modules contained in the LUW. -# If one of the RFC_SERVER_FUNCTION implementations returns an error code, RFC_ON_ROLLBACK_TRANSACTION is called. Here you should roll back all the work of all the previous RFC_SERVER_FUNCTIONs. (The easiest way is to do a database ROLLBACK WORK here.)\n If all RFC_SERVER_FUNCTIONs complete successfully, RFC_ON_COMMIT_TRANSACTION is called at the end. Persist all the changes here (e.g. do a COMMIT WORK).\n Note: Normally you'll only have "one-function-module LUWs", e.g. IDocs. In this case the RFC_SERVER_FUNCTION can already commit/rollback its own work, before returning RFC_OK or an error code. So the two functions RFC_ON_ROLLBACK_TRANSACTION and RFC_ON_COMMIT_TRANSACTION can be empty in this case. -# In the end RFC_ON_CONFIRM_TRANSACTION will be called. All information stored about that transaction can now be discarded by the server, as it no longer needs to protect itself against duplicates. In general this function can be used to delete the transaction ID from permanent storage.

If you pass NULL as "sysId", the transaction handlers will be used for tRFC calls from any backend system, for which no explicit handlers have been installed.

\in *sysId System ID of the SAP system for which to use this set of transaction handlers, or NULL. \in onCheckFunction Pointer to a function of type RFC_ON_CHECK_TRANSACTION. \in onCommitFunction Pointer to a function of type RFC_ON_COMMIT_TRANSACTION. \in onRollbackFunction Pointer to a function of type RFC_ON_ROLLBACK_TRANSACTION. \in onConfirmFunction Pointer to a function of type RFC_ON_CONFIRM_TRANSACTION. \out *errorInfo Additional information, in case the handlers could not be installed. \return RFC_RC