One Star

Transaction bracket / group

Hi *,
for a migration case I need to group the insert actions into three/four tables into ONE transaction. That has to be done RECORDWISE, meaning per source record three/four records in target tables have to be written. If I get an insert error, the transaction for THIS source record has to be rolled back and protocoled. Then the next source record starts this cycle again.
In the documentation I only found COMMIT/ROLLBACK operations for the complete operation, meaning for ALL source records at once.
Any suggestion/pointer appreciated.
Thanks,
Steve
1 REPLY
Seven Stars

Re: Transaction bracket / group

How about using flows from the tMap e.g.
-- first output flow from tMap to tJavaRow with: globalMap.put("Commit",true);
-- then your current three output flows to your DB
- each reject flow from the output components should also go to a tJavaRow with: globalMap.put("Commit",false);
-- fifth output flow from tMap to commit component with filter: (Boolean)globalMap.get("Commit")
-- sixth output flow from tMap to rollback component with filter: !(Boolean)globalMap.get("Commit")