work
work copied to clipboard
Utilize stack data structure internally.
Description
By nature, the sequence that occurs in order to successfully save or rollback is well suited for being managed by a stack data structure. In general, construction of the internal stack will occur based on the options provided to the work unit at construction time. During the save process, each sequence will be processed by popping it off of the stack and placed on a separate stack (the "rollback stack") that maintains the reverse order. If a rollback is required, we instead continue to process the rollback stack until it is empty.