counter = persistent(0) # Defines a persistent variable with default value 0
def endBatch():
debug('endBatch')
counter.value += 1
# The persistent variable is persisted after this function block has been executed
def commit():
debug('commit')
# The persistent variable is available in commit during both normal and recovery commits
debug(counter)
|