diff --git a/src/main/java/org/olat/commons/coordinate/cluster/jms/ClusterEventBus.java b/src/main/java/org/olat/commons/coordinate/cluster/jms/ClusterEventBus.java index 68a8d8fa9989e26bd4816ee20f0fefb82b4328f2..8f3c141b62f50a2ced169e093a89e48bb1482f1f 100644 --- a/src/main/java/org/olat/commons/coordinate/cluster/jms/ClusterEventBus.java +++ b/src/main/java/org/olat/commons/coordinate/cluster/jms/ClusterEventBus.java @@ -196,6 +196,12 @@ public class ClusterEventBus extends AbstractEventBus implements MessageListener } catch(Error er) { log.error("Error enountered by serve-thread:", er); // continue + } finally { + try { + DBFactory.getInstance().commitAndCloseSession(); + } catch (Exception e) { + e.printStackTrace(); + } } } @@ -256,7 +262,7 @@ public class ClusterEventBus extends AbstractEventBus implements MessageListener */ public void fireEventToListenersOf(MultiUserEvent event, OLATResourceable ores) { // 1. fire directly within vm, because it used to be so before, and in this way this olat node can run even if jms is down - doFire(event, ores); + //TODO jms doFire(event, ores); // 2. send the event wrapped over jms to all nodes // (the receiver will detect whether messages are from itself and thus can be ignored, since they were already sent directly. @@ -373,11 +379,11 @@ public class ClusterEventBus extends AbstractEventBus implements MessageListener // message with destination and source both having this vm are ignored here, since they were already // "inline routed" when having been sent (direct call within the vm). - if (!fromSameNode) { + //TODO jms if (!fromSameNode) { // distribute the unmarshalled event to all JVM wide listeners for this channel. doFire(event, ores); DBFactory.getInstance(false).commitAndCloseSession(); - } // else message already sent "in-vm" + //TODO jms } // else message already sent "in-vm" // stats final long doneTime = System.currentTimeMillis(); diff --git a/src/main/resources/serviceconfig/org/olat/core/_spring/olatcoreconfig.xml b/src/main/resources/serviceconfig/org/olat/core/_spring/olatcoreconfig.xml index d3deaa26ff601dc43377f1e83c2eb90f7460f733..11a169ce8848e544fe3771827f91b76eed6c6059 100644 --- a/src/main/resources/serviceconfig/org/olat/core/_spring/olatcoreconfig.xml +++ b/src/main/resources/serviceconfig/org/olat/core/_spring/olatcoreconfig.xml @@ -18,7 +18,7 @@ </bean> <bean id="coordinatorManager" class="org.olat.core.util.coordinate.CoordinatorManagerImpl"> - <property name="coordinator" ref="org.olat.core.util.coordinate.${cluster.mode}Coordinator"/> + <property name="coordinator" ref="org.olat.core.util.coordinate.ClusterCoordinator"/> </bean> @@ -38,13 +38,14 @@ <property name="eventBus" ref="org.olat.commons.coordinate.cluster.jms.ClusterEventBus" /> <property name="cacher" ref="infinispanCacher"/> </bean> - +<!-- <bean id="org.olat.core.util.coordinate.SingleVMCoordinator" class="org.olat.commons.coordinate.singlevm.SingleVMCoordinator" lazy-init="true"> <property name="syncer" ref="org.olat.commons.coordinate.cluster.ClusterSyncer"/> <property name="eventBus" ref="org.olat.commons.coordinate.singlevm.SingleVMEventBus"/> <property name="locker" ref="org.olat.commons.coordinate.singlevm.SingleVMLocker"/> <property name="cacher" ref="infinispanCacher"/> </bean> +--> <bean id="infinispanCacheManager" class="org.olat.core.util.cache.infinispan.InfinispanCacheManager" destroy-method="stop"> <property name="configuration" value="infinispan-config.xml"/> @@ -143,13 +144,14 @@ init-method="springInit" destroy-method="stop" lazy-init="true"> </bean> <bean id="clusterLockManager" class="org.olat.commons.coordinate.cluster.lock.ClusterLockManager"/> - +<!-- <bean id="org.olat.commons.coordinate.singlevm.SingleVMEventBus" class="org.olat.commons.coordinate.singlevm.SingleVMEventBus" lazy-init="true"/> <bean id="org.olat.commons.coordinate.singlevm.SingleVMLocker" class="org.olat.commons.coordinate.singlevm.SingleVMLocker" init-method="init" lazy-init="true"> <property name="eventBus" ref="org.olat.commons.coordinate.singlevm.SingleVMEventBus"/> <lookup-method name="getPersistentLockManager" bean="persistentLockManager"/> </bean> +--> <import resource="classpath:/serviceconfig/org/olat/core/_spring/olatcorejms_${jms.provider}.xml"/>