Article Details
Id:12494
Product:finPOWER Connect
Type:FIX
Version:2.02.04
Opened:10/12/2014
Closed:11/12/2014
Released:13/02/2015
Job: J014621

Scripting; finAccountProcesses.Execute may return True, but leave a Database Transaction rolling back

There is a potential issue with the finAccountProcesses.Execute method in the POWER Connect Business Layer when used in a script AND the script has the database in a Transaction when this function is called.

Account Processes is designed to ignore individual Account errors and continue to process the next Account. This means the overall function may return True, but individual Account errors may have occurred. Because Account Processes starts its own database transaction for each Account, if the Account fails the database transaction is rolled back. However, once a nested database transaction is rolled back all outer database transactions must also be rolled back.

The issue is Account Processes was not factoring in that it might have been run from another process that had already started a database transaction. It returns True (success) but leaves the database transaction is a rollback state - and the calling script code would see success and continue its work and then fail.

One reason for an Account to fail in Account Processes is the date of a Transaction is prior to the Entity Close To date.

Note, this can also cause other functions to fail that utilise Account Processes. For example, the finAccountPayArrangementAdd.ExecuteCommit may call finAccountProcesses.Execute if there is a payment due on the date of the Arrangement.