Implementation Guidelines (Magic xpi 4.13)
These are some general points regarding SAP Business One (SAPB1) connector connections:
-
Each SAPB1 connection is a resource that consumes memory. If you do not close the connection by selecting either the Keep Session Open check box or the Disconnect command, the memory will continue to be occupied by the connection until the server shuts down.
-
It is not recommended to close the connection after each SAPB1 step, since establishing a connection is a heavy process that affects performance significantly.
-
When a connection is left idle for an undetermined length of time, the SAPB1 connector might lose its connection reference. To prevent this from happening, you should close the connection at the end of the logical process, and not after each step or each flow.
To start a transaction in SAP Business One, you should use the Start Transaction method. Magic xpi will then automatically lock access to SAP Business One in all flows and all connections accessing the same SAP Business One Server and Database until Commit or Rollback commands are executed.
Following this recommendation ensures that no SAPB1 step will access the same Server and Database while a transaction is still open. It is also recommended to define an error flow on all flows that use the critical section. This error flow will rollback the SAPB1 transaction, and unlock the critical section if an error occurs. The last step of this error flow should be a Flow Data utility. The function of this Flow Data utility is to update the C.sys.ErrorCode with the error code that the flow error mechanism is to handle.