Skip to content

Units of work and handlers -> @Transactional boundaries and exception mapping (#3621) - #3675

Merged
squid-protocol merged 1 commit into
mainfrom
feat/uow-transactional-3621
Sep 25, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
feat/uow-transactional-3621

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3621 (epic #3625).

A CICS task is one unit of work: CICS commits at task end and backs out on an abend, which is exactly @transactional method-boundary semantics. The new UowForge, registered in the #3657 SkeletonForges pipeline, builds from the field-tested units of work and handlers channel.

COBOL generated in the program's @Service
a CICS program, or explicit COMMIT / ROLLBACK @Transactional on the class
EXEC CICS SYNCPOINT / EXEC SQL COMMIT commitPointL<line>(): documented as a transaction split point (TransactionTemplate), with a TODO. Never a faked commit
SYNCPOINT ROLLBACK rollbackL<line>() throws UnitOfWorkRollbackException, and the boundary rolls back
EXEC CICS ABEND ABCODE(x) abend<X>L<line>() throws CicsAbendException
HANDLE ABEND / HANDLE CONDITION c onAbendL<line>() / onCondition<C>L<line>(), with a TODO to port the target paragraph
RESP checks / responses never tested a class note: "READ at line 10 tests NORMAL" / "TODO: the RESP of READ at line 14 (paragraph P) is never tested"

Generated once, only when a service uses them: CicsAbendException, CicsConditionException and UnitOfWorkRollbackException (package exception), plus, with REST controllers, CicsExceptionAdvice (NOTFND 404, DUPREC/DUPKEY 409, NOTAUTH 403, INVREQ/LENGERR 400, else 500; abend 500; rollback 409).

Every method cites file:line, paragraph, and field-testing status. Service extras gain optional annotations / class_doc; a service without them is byte-identical.

corpus @transactional commits rollbacks abends handlers unchecked RESPs
CardDemo 25 14 2 5 11 40
CBSA 28 3 16 60 9 14
GENAPP 31 0 10 24 5 150
zECS 5 3 1 0 1 73

Verified

  • Compile: 6 corpora × 13 configs compile via --scan.
  • Preflight: all gates PASS. Full suite: 11,663 passed.
  • Tests: a real-scan estate (CICS + batch + a program with no facts); plain classes; a CICS program without handlers generating no exception package.

Provenance

Drafted by an agy (Gemini 3.1 Pro) agent. Review:

  • it now plans once (the counters were bumped on every service_extras call);
  • it generates and imports the exception package only when used (a handler-less CICS program imported a package that did not exist; a test pins this);
  • it cites real paths (they printed a literal file:);
  • it fixes 2 lint + 2 type findings the agent's run missed, caught by the new preflight gates.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

… mapping (#3621)

A CICS task is one unit of work: CICS commits at task end and backs out
on an abend, which is @transactional method-boundary semantics. A new
UowForge (cobol_to_java_uow_forge.py), registered in SkeletonForges,
builds from the field-tested `units of work and handlers` channel.

Each program's @service gains:
- @transactional, for a CICS program or one with an explicit COMMIT /
  ROLLBACK;
- commitPointL<line>(): an explicit SYNCPOINT / SQL COMMIT, documented
  as a transaction split point, never a faked commit;
- rollbackL<line>(): SYNCPOINT ROLLBACK, throwing
  UnitOfWorkRollbackException;
- abend<CODE>L<line>(): an explicit ABEND, throwing CicsAbendException;
- onAbendL / onCondition<C>L: HANDLE ABEND / CONDITION routes, with a
  TODO to port the target paragraph;
- a class note of RESP checks and every response never tested (up to 30).

CicsAbendException, CicsConditionException, UnitOfWorkRollbackException
(package exception) and a CicsExceptionAdvice (package web: NOTFND 404,
DUPREC/DUPKEY 409, NOTAUTH 403, INVREQ/LENGERR 400, else 500; abend
500; rollback 409) are generated once, only when a service uses them.

Service extras gain `annotations` and `class_doc`, merged by
merge_extras. A service without them is byte-identical.

Corpora:
| corpus   | @transactional | commits | rollbacks | abends | handlers | unchecked RESPs |
|----------|----------------|---------|-----------|--------|----------|-----------------|
| CardDemo | 25             | 14      | 2         | 5      | 11       | 40              |
| CBSA     | 28             | 3       | 16        | 60     | 9        | 14              |
| GENAPP   | 31             | 0       | 10        | 24     | 5        | 150             |
| zECS     | 5              | 3       | 1         | 0      | 1        | 73              |
6 corpora x 13 configs compile via --scan; preflight all PASS; full
suite 11,663 passed.

Drafted by an agy (Gemini 3.1 Pro) agent. Review:
- plans once in __init__ (the counters used to be bumped per
  service_extras call);
- generates and imports the exception package only when a service
  uses it (a CICS program without handlers imported a package that did
  not exist; a test pins it);
- cites real file:line paths (they printed a literal "file:");
- fixed 2 lint + 2 type findings the agent's run missed, caught by
  preflight.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 5272a9a into main Sep 25, 2026
36 checks passed
@squid-protocol
squid-protocol deleted the feat/uow-transactional-3621 branch September 25, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Java conversion: units of work and handlers -> @Transactional boundaries and exception mapping

1 participant