Oracle Message ORA-24787 - remote cursors must be closed before a call completes

ERRORremote cursors must be closed before a call completes
CAUSEThe previous operation did not close all the remote cursors it opened. Since separated transactions are enabled, this is not allowed.
ACTIONClose all remote cursors in each call, or start a regular (non-separated) transaction.