Commit Graph
24 Commits
Author SHA1 Message Date
asmhatre 448c383879 Add jdbc-vs-jpa module: Spring Data JDBC vs JPA on a shared Order aggregate
Same Customer/Order/OrderItem domain modelled with Hibernate/Spring Data JPA and
Spring Data JDBC side by side, both running through a shared StatementLoggingDataSource
so SQL-statement counts are directly comparable. 11 tests, 11 captured transcripts,
6 doc chapters. Companion repo for the ankurm.com article on when to drop the ORM.
2026-09-17 19:09:35 +00:00
asmhatreandClaude Opus 5 585eed4d57 Add the transactions module, and move the migration project under migration-behavior/
The repository now aggregates two independent modules. migration-behavior/ is the
original project, moved unchanged; it stays on Spring Boot 4.0.6 / JDK 21 because
that is what the four published migration articles were verified against, and
upgrading it would silently invalidate output they quote. The article-tagged trees
are untouched, so links into a tag are unaffected.

transactions/  Companion code for "@Transactional in Spring: Propagation, Isolation,
and the Six Ways It Silently Does Nothing". Spring Boot 4.1.1 / JDK 25.

Every row of the propagation matrix is produced by calling the method and asking the
transaction manager what it did. The transaction NAME is the exhibit: a scope that
joined reports its caller's name, a scope that started its own reports its own.

Three things the transcripts settle:

  - Propagation.NESTED cannot be used with JpaTransactionManager. It fails twice,
    with two different messages, the second of which blames your JPA provider. The
    savepoint manager comes from the object the JpaDialect returns when it begins the
    transaction, and Hibernate's does not implement one. It works on
    DataSourceTransactionManager, because a savepoint is a JDBC concept -- shown
    working there rather than only failing here.
  - Catching a REQUIRED inner failure does not save the transaction. The inner scope
    has already marked it rollback-only, so the commit throws
    UnexpectedRollbackException from a place with no connection to the cause.
  - A checked exception commits, and so does a swallowed one. Those two do not merely
    fail to start a transaction; they commit work the code was abandoning.

19 contract tests, six captured transcripts, all regenerated by scripts/run-all.sh.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gip4srpzMwjgoba6uEfbr5
2026-09-08 16:47:51 +00:00
asmhatre 879a06929a README: document the 4-article series and the corner-scenarios enrichment 2026-07-25 08:21:13 +00:00
asmhatre 51d876d1a7 Tests: add 6 corner-scenario tests (Specification family, JpaSort.unsafe, Money value object) - 13 total, all green corner-scenarios 2026-07-25 08:20:29 +00:00
asmhatre 382e31cc37 DemoRunner: add sections H-L (Specification family, JpaSort.unsafe, Money value object) 2026-07-25 08:20:14 +00:00
asmhatre 0eaac42e01 BookRepository: embedded-path queries + record projection (with the nested-path projection corner case) 2026-07-25 08:19:49 +00:00
asmhatre 9d42a42d26 Book: replace BigDecimal price with embedded Money value object 2026-07-25 08:19:45 +00:00
asmhatre 68b40c903b Add AuthorSpecifications: PredicateSpecification/DeleteSpecification/UpdateSpecification helpers 2026-07-25 08:18:37 +00:00
asmhatre f68ce9b41a Add BookSummary record projection (corner-scenario enrichment) 2026-07-25 08:18:30 +00:00
asmhatre 34cba41805 Add Money embeddable value object (corner-scenario enrichment) 2026-07-25 08:18:27 +00:00
asmhatre b3db1a66e7 Add missing Maven wrapper script (mvnw.cmd) 2026-07-25 06:25:21 +00:00
asmhatre 626b053df5 Add missing Maven wrapper script (mvnw) 2026-07-25 06:24:52 +00:00
asmhatre cbcb80c247 Add README article-1-baseline article-2-query-engine article-3-advanced 2026-07-25 05:36:45 +00:00
asmhatre 9928de8900 Add MigrationBehaviorTests.java 2026-07-25 05:36:40 +00:00
asmhatre e9f6c6d15d Add application.properties 2026-07-25 05:36:34 +00:00
asmhatre 7eb279d254 Add package-info.java 2026-07-25 05:36:31 +00:00
asmhatre 302eaab66f Add BookRepository.java 2026-07-25 05:36:28 +00:00
asmhatre de5cdf0bf8 Add AuthorRepository.java 2026-07-25 05:36:25 +00:00
asmhatre 0ab2838dc8 Add Book.java 2026-07-25 05:36:20 +00:00
asmhatre 789e256407 Add Author.java 2026-07-25 05:36:17 +00:00
asmhatre 48c6c068c6 Add DemoRunner.java 2026-07-25 05:36:13 +00:00
asmhatre 36c678ee80 Add Application.java 2026-07-25 05:36:01 +00:00
asmhatre 85de01f697 Add maven wrapper properties 2026-07-25 05:35:58 +00:00
asmhatre 0d2cfa6b59 Add pom.xml 2026-07-25 05:35:55 +00:00