Comlete record insertion while failing ESS job
Content (required):
We 're running Groovy function with Schedule Custom Groovy Object Functions ESS job.
Function body:
def exceptionErrorMessage = '' try{ //do processing } catch (Exception ex){ exceptionErrorMessage = ex.getMessage() } finally{ //1. create new record (doesn't work - record is not created) //2. rethrow exception (works, job completed with Status Error) }
This is expected behavior per documentation :
Each job run constitutes a transaction. This means that all the operations specified by the Groovy script in the object function have to run to completion to complete the transaction. Otherwise, the transaction is rolled back and no records are updated.
Is there any trick to complete both steps 1-2?
Tagged:
0