This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch CAUSEWAY-3866 in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 7c83d21d6e3e82720146d555df2ea9c702bc82dd Author: Dan Haywood <[email protected]> AuthorDate: Fri Oct 17 13:21:58 2025 +0100 CAUSEWAY-3866: removes references to JdoSupportService, also TransactionService#nextTransaction --- .../modules/applib-svc/partials/module-nav.adoc | 3 -- .../hints-and-tips/transactions-and-errors.adoc | 25 +----------- .../transaction/TransactionServiceSpring.java | 44 ---------------------- 3 files changed, 1 insertion(+), 71 deletions(-) diff --git a/antora/components/refguide/modules/applib-svc/partials/module-nav.adoc b/antora/components/refguide/modules/applib-svc/partials/module-nav.adoc index 41d3c4dab12..1631b1d4ffe 100644 --- a/antora/components/refguide/modules/applib-svc/partials/module-nav.adoc +++ b/antora/components/refguide/modules/applib-svc/partials/module-nav.adoc @@ -86,9 +86,6 @@ ** Viewer Common Applib *** xref:refguide:viewer:index/commons/applib/services/userprof/UserProfileUiService.adoc[UserProfileUiService] -** Persistence JDO Applib -*** xref:refguide:persistence:index/jdo/applib/services/JdoSupportService.adoc[] - ** Persistence JPA Applib *** xref:refguide:persistence:index/jpa/applib/services/JpaSupportService.adoc[] diff --git a/antora/components/userguide/modules/btb/partials/hints-and-tips/transactions-and-errors.adoc b/antora/components/userguide/modules/btb/partials/hints-and-tips/transactions-and-errors.adoc index b10d7cd8426..3751dedd06a 100644 --- a/antora/components/userguide/modules/btb/partials/hints-and-tips/transactions-and-errors.adoc +++ b/antora/components/userguide/modules/btb/partials/hints-and-tips/transactions-and-errors.adoc @@ -7,30 +7,7 @@ In Apache Causeway, every interaction (action invocation or property edit) is automatically wrapped in a transaction, and any repository query automatically does a flush before hand. What that means is that there's no need to explicitly start or commit transactions in Apache Causeway; this will be done for you. -Indeed, if you do try to manage transactions (eg by reaching into the JDO `PersistenceManager` exposed by the xref:refguide:persistence:index/jdo/applib/services/JdoSupportService.adoc[JdoSupportService] domain service, then you are likely to confuse the framework and get a stack trace for your trouble. - -However, you can complete a given transaction and start a new one. -This is sometimes useful if writing a xref:testing:fixtures:about.adoc[fixture script] which is going to perform some sort of bulk migration of data from an old system. -For this use case, use the xref:refguide:applib:index/services/xactn/TransactionService.adoc[TransactionService]. - -For example: - -[source,java] ----- -public class SomeLongRunningFixtureScript extends FixtureScript { - - protected void execute(final ExecutionContext executionContext) { - // do some work - transactionService.nextTransaction(); - // do some work - transactionService.nextTransaction(); - // do yet more work - } - - @javax.inject.Inject - TransactionService transactionService; -} ----- +Indeed, if you do try to manage transactions (eg by reaching into the JPA `EntityManager` exposed by the xref:refguide:persistence:index/jpa/applib/services/JpaSupportService.adoc[JpaSupportService] domain service, then you are likely to confuse the framework and get a stack trace for your trouble. == Raise message in the UI diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/transaction/TransactionServiceSpring.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/transaction/TransactionServiceSpring.java index db52ec055e8..1c91bf6736b 100644 --- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/transaction/TransactionServiceSpring.java +++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/transaction/TransactionServiceSpring.java @@ -168,50 +168,6 @@ private void registerTransactionSynchronizations(final TransactionStatus txStatu } } -// @Override -// public void nextTransaction() { -// -// var txManager = singletonTransactionManagerElseFail(); -// -// try { -// -// var txTemplate = new TransactionTemplate(txManager); -// txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); -// -// // either reuse existing or create new -// var txStatus = txManager.getTransaction(txTemplate); -// if(txStatus.isNewTransaction()) { -// // we have created a new transaction, so we are done -// return; -// } -// // we are reusing an exiting transaction, so end it and create a new one afterwards -// if(txStatus.isRollbackOnly()) { -// txManager.rollback(txStatus); -// } else { -// //XXX we removed the entire method, because of following subtlety - // If the transaction wasn't a new one, omit the commit for proper participation in -// // the surrounding transaction. If a previous transaction has been suspended to be -// // able to create a new one, resume the previous transaction after committing the new one. -// txManager.commit(txStatus); -// } -// -// // begin a new transaction -// txManager.getTransaction(txTemplate); -// -// } catch (RuntimeException ex) { -// -// var translatedEx = translateExceptionIfPossible(ex, txManager); -// -// if(translatedEx instanceof RuntimeException) { -// throw ex; -// } -// -// throw new RuntimeException(ex); -// -// } -// -// } - @Override public void flushTransaction() {
