You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/12/22 23:41:55 UTC
[isis] branch master updated: ISIS-2033: remove the concept of
flushing a session; instead thats done by the TransactionService
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/master by this push:
new 05090cf ISIS-2033: remove the concept of flushing a session; instead thats done by the TransactionService
05090cf is described below
commit 05090cf095cc67885d84d8047e95a75ab90eca64
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Dec 23 00:41:42 2020 +0100
ISIS-2033: remove the concept of flushing a session; instead thats done
by the TransactionService
---
.../events/IsisInteractionLifecycleEvent.java | 1 -
.../core/runtime/events/AppLifecycleEventService.java | 7 -------
.../lifecycles/JdoPersistenceLifecycleService.java | 8 --------
.../jdo/integration/persistence/PersistenceSession.java | 16 ----------------
.../viewer/wicket/ui/panels/FormExecutorDefault.java | 6 +++---
5 files changed, 3 insertions(+), 35 deletions(-)
diff --git a/core/interaction/src/main/java/org/apache/isis/core/interaction/events/IsisInteractionLifecycleEvent.java b/core/interaction/src/main/java/org/apache/isis/core/interaction/events/IsisInteractionLifecycleEvent.java
index 03e6332..fb6a868 100644
--- a/core/interaction/src/main/java/org/apache/isis/core/interaction/events/IsisInteractionLifecycleEvent.java
+++ b/core/interaction/src/main/java/org/apache/isis/core/interaction/events/IsisInteractionLifecycleEvent.java
@@ -30,7 +30,6 @@ public class IsisInteractionLifecycleEvent {
public enum EventType {
HAS_STARTED,
IS_ENDING,
- FLUSH_REQUEST,
}
@Getter String conversationId;
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/events/AppLifecycleEventService.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/events/AppLifecycleEventService.java
index 2306b4e..a110056 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/events/AppLifecycleEventService.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/events/AppLifecycleEventService.java
@@ -77,13 +77,6 @@ public class AppLifecycleEventService {
IsisInteractionLifecycleEvent
.of(conversationId, interactionSession, IsisInteractionLifecycleEvent.EventType.IS_ENDING));
}
-
- public void fireInteractionFlushRequest(InteractionSession interactionSession) {
- val conversationId = interactionTracker.getConversationId().orElse(null);
- eventBusService.post(
- IsisInteractionLifecycleEvent
- .of(conversationId, interactionSession, IsisInteractionLifecycleEvent.EventType.FLUSH_REQUEST));
- }
// -- PERSISTENT OBJECT EVENTS
diff --git a/persistence/jdo/integration/src/main/java/org/apache/isis/persistence/jdo/integration/lifecycles/JdoPersistenceLifecycleService.java b/persistence/jdo/integration/src/main/java/org/apache/isis/persistence/jdo/integration/lifecycles/JdoPersistenceLifecycleService.java
index dd6b0f9..d0757d1 100644
--- a/persistence/jdo/integration/src/main/java/org/apache/isis/persistence/jdo/integration/lifecycles/JdoPersistenceLifecycleService.java
+++ b/persistence/jdo/integration/src/main/java/org/apache/isis/persistence/jdo/integration/lifecycles/JdoPersistenceLifecycleService.java
@@ -100,9 +100,6 @@ public class JdoPersistenceLifecycleService {
case IS_ENDING:
onInteractionEnding(interactionSession);
break;
- case FLUSH_REQUEST:
- onInteractionFlushRequest(interactionSession);
- break;
default:
throw _Exceptions.unmatchedCase(eventType);
@@ -124,11 +121,6 @@ public class JdoPersistenceLifecycleService {
.ifPresent(PersistenceSession::close);
}
- private void onInteractionFlushRequest(final InteractionSession interactionSession) {
- currentSession(interactionSession)
- .ifPresent(PersistenceSession::flush);
- }
-
private Optional<IsisPersistenceSessionJdo> currentSession(final InteractionSession interactionSession) {
return Optional.ofNullable(interactionSession)
.map(session->session.getAttribute(IsisPersistenceSessionJdo.class));
diff --git a/persistence/jdo/integration/src/main/java/org/apache/isis/persistence/jdo/integration/persistence/PersistenceSession.java b/persistence/jdo/integration/src/main/java/org/apache/isis/persistence/jdo/integration/persistence/PersistenceSession.java
index 6e0c62b..69de8d7 100644
--- a/persistence/jdo/integration/src/main/java/org/apache/isis/persistence/jdo/integration/persistence/PersistenceSession.java
+++ b/persistence/jdo/integration/src/main/java/org/apache/isis/persistence/jdo/integration/persistence/PersistenceSession.java
@@ -25,7 +25,6 @@ import javax.annotation.Nullable;
import org.apache.isis.applib.query.Query;
import org.apache.isis.applib.services.repository.EntityState;
-import org.apache.isis.applib.services.xactn.TransactionService;
import org.apache.isis.commons.collections.Can;
import org.apache.isis.core.metamodel.context.MetaModelContext;
import org.apache.isis.core.metamodel.spec.ManagedObject;
@@ -37,16 +36,11 @@ public interface PersistenceSession {
// -- STABLE API (DRAFT)
// -------------------------------------------------------------------------------------------------
- TransactionService getTransactionService();
MetaModelContext getMetaModelContext();
void open();
void close();
- default void flush() {
- getTransactionService().flushTransaction();
- }
-
default ManagedObject adapterFor(@Nullable Object pojo) {
return _Utils.adapterFor(getMetaModelContext(), pojo);
}
@@ -58,16 +52,6 @@ public interface PersistenceSession {
/**
- * Re-initializes the fields of an object. If the object is unresolved then
- * the object's missing data should be retrieved from the persistence
- * mechanism and be used to set up the value objects and associations.
- * @since 2.0
- */
- default void refreshRootInTransaction(final Object domainObject) {
- getTransactionService().executeWithinTransaction(()->refreshRoot(domainObject));
- }
-
- /**
* @param pojo a persistable object
* @return String representing an object's id.
* @since 2.0
diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/FormExecutorDefault.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/FormExecutorDefault.java
index 76920fa..d0f3d56 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/FormExecutorDefault.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/panels/FormExecutorDefault.java
@@ -42,6 +42,7 @@ import org.apache.isis.applib.services.exceprecog.ExceptionRecognizerService;
import org.apache.isis.applib.services.i18n.TranslationService;
import org.apache.isis.applib.services.message.MessageService;
import org.apache.isis.applib.services.registry.ServiceRegistry;
+import org.apache.isis.applib.services.xactn.TransactionService;
import org.apache.isis.commons.functional.Result;
import org.apache.isis.commons.internal.collections._Sets;
import org.apache.isis.core.interaction.session.InteractionFactory;
@@ -52,7 +53,6 @@ import org.apache.isis.core.metamodel.spec.ManagedObject;
import org.apache.isis.core.metamodel.spec.ManagedObjects.EntityUtil;
import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
import org.apache.isis.core.runtime.context.IsisAppCommonContext;
-import org.apache.isis.core.runtime.events.AppLifecycleEventService;
import org.apache.isis.core.runtime.memento.ObjectMemento;
import org.apache.isis.viewer.wicket.model.isis.WicketViewerSettings;
import org.apache.isis.viewer.wicket.model.models.ActionModel;
@@ -141,8 +141,8 @@ implements FormExecutor {
val commonContext = targetEntityModel.getCommonContext();
commonContext.getInteractionTracker().currentInteractionSession()
.ifPresent(interaction->{
- commonContext.lookupServiceElseFail(AppLifecycleEventService.class)
- .fireInteractionFlushRequest(interaction);
+ commonContext.lookupServiceElseFail(TransactionService.class)
+ .flushTransaction();
});
}