Error :: Failed to run scheduled task ClearExpiredUserSessions

After upgrading to keyclok18, i see this info/warning in my log like

{"timestamp":"2022-08-11T22:48:07.222Z","sequence":8609,"loggerClassName":"com.arjuna.ats.arjuna.logging.arjunaI18NLogger_$logger","loggerName":"com.arjuna.ats.arjuna","level":"INFO","message":"ARJUNA012404: Action id 0:ffff0a0093a0:8a8f:62f511f7:44da2 - thread Timer-0 at time 22:46:07.219 had stackTrace java.base@11.0.15/java.net.SocketInputStream.socketRead0(Native Method)\njava.base@11.0.15/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)\njava.base@11.0.15/java.net.SocketInputStream.read(SocketInputStream.java:168)\njava.base@11.0.15/java.net.SocketInputStream.read(SocketInputStream.java:140)\njava.base@11.0.15/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)\njava.base@11.0.15/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)\njava.base@11.0.15/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)\njava.base@11.0.15/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1454)\njava.base@11.0.15/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1065)\njava.base@11.0.15/java.io.FilterInputStream.read(FilterInputStream.java:133)\ncom.mysql.cj.protocol.FullReadInputStream.readFully(FullReadInputStream.java:64)\ncom.mysql.cj.protocol.a.SimplePacketReader.readHeaderLocal(SimplePacketReader.java:81)\ncom.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:63)\ncom.mysql.cj.protocol.a.SimplePacketReader.readHeader(SimplePacketReader.java:45)\ncom.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:52)\ncom.mysql.cj.protocol.a.TimeTrackingPacketReader.readHeader(TimeTrackingPacketReader.java:41)\ncom.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:54)\ncom.mysql.cj.protocol.a.MultiPacketReader.readHeader(MultiPacketReader.java:44)\ncom.mysql.cj.protocol.a.NativeProtocol.readMessage(NativeProtocol.java:514)\ncom.mysql.cj.protocol.a.NativeProtocol.checkErrorMessage(NativeProtocol.java:700)\ncom.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:639)\ncom.mysql.cj.protocol.a.NativeProtocol.sendQueryPacket(NativeProtocol.java:987)\ncom.mysql.cj.NativeSession.execSQL(NativeSession.java:666)\ncom.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:930)\ncom.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1009)\ncom.mysql.cj.jdbc.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:581)\nio.agroal.pool.wrapper.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:78)\norg.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)\norg.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.getResultSet(AbstractLoadPlanBasedLoader.java:390)\norg.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeQueryStatement(AbstractLoadPlanBasedLoader.java:163)\norg.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader.executeLoad(AbstractLoadPlanBasedLoader.java:104)\norg.hibernate.loader.collection.plan.AbstractLoadPlanBasedCollectionInitializer.initialize(AbstractLoadPlanBasedCollectionInitializer.java:87)\norg.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:705)\norg.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:76)\norg.hibernate.internal.SessionImpl$$Lambda$1117/0x0000000800b99040.accept(Unknown Source)\norg.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)\norg.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:2203)\norg.hibernate.collection.internal.AbstractPersistentCollection$4.doWork(AbstractPersistentCollection.java:595)\norg.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:264)\norg.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:591)\norg.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:149)\norg.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.java:387)\njava.base@11.0.15/java.util.Spliterators$IteratorSpliterator.estimateSize(Spliterators.java:1821)\njava.base@11.0.15/java.util.Spliterator.getExactSizeIfKnown(Spliterator.java:408)\njava.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483)\njava.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)\njava.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\njava.base@11.0.15/java.util.stream.ReferencePipeline.forEachOrdered(ReferencePipeline.java:502)\norg.keycloak.models.cache.infinispan.entities.CachedRealm.<init>(CachedRealm.java:279)\norg.keycloak.models.cache.infinispan.RealmCacheSession.getRealm(RealmCacheSession.java:414)\norg.keycloak.models.jpa.JpaRealmProvider$$Lambda$1102/0x0000000800b9e040.apply(Unknown Source)\njava.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\njava.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)\njava.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)\njava.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)\njava.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)\njava.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\njava.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)\norg.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)\norg.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)\norg.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider.removeAllExpired(InfinispanUserSessionProvider.java:601)\norg.keycloak.services.scheduled.ClearExpiredUserSessions.run(ClearExpiredUserSessions.java:39)\norg.keycloak.services.scheduled.ScheduledTaskRunner.runTask(ScheduledTaskRunner.java:74)\norg.keycloak.services.scheduled.ScheduledTaskRunner.run(ScheduledTaskRunner.java:55)\norg.keycloak.timer.basic.BasicTimerProvider$1.run(BasicTimerProvider.java:53)\njava.base@11.0.15/java.util.TimerThread.mainLoop(Timer.java:556)\njava.base@11.0.15/java.util.TimerThread.run(Timer.java:506)\n","threadName":"Transaction Reaper Worker 0","threadId":44,"mdc":{},"ndc":"","hostName":"mykeycloakhost-aw-us-1","processName":"QuarkusEntryPoint","processId":1}

{"timestamp":"2022-08-11T22:48:07.222Z","sequence":8610,"loggerClassName":"com.arjuna.ats.arjuna.logging.arjunaI18NLogger_$logger","loggerName":"com.arjuna.ats.arjuna","level":"INFO","message":"ARJUNA012404: Action id 0:ffff0a0093a0:8a8f:62f511f7:44da2 - thread Timer-0 at time 22:46:37.219 had stackTrace org.hibernate.engine.spi.CollectionEntry.preFlush(CollectionEntry.java:172)\norg.hibernate.event.internal.AbstractFlushingEventListener.lambda$prepareCollectionFlushes$0(AbstractFlushingEventListener.java:195)\norg.hibernate.event.internal.AbstractFlushingEventListener$$Lambda$1163/0x0000000800bee440.accept(Unknown Source)\norg.hibernate.engine.internal.StatefulPersistenceContext.forEachCollectionEntry(StatefulPersistenceContext.java:1136)\norg.hibernate.event.internal.AbstractFlushingEventListener.prepareCollectionFlushes(AbstractFlushingEventListener.java:194)\norg.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:86)\norg.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)\norg.hibernate.internal.SessionImpl$$Lambda$1097/0x0000000800b9fc40.accept(Unknown Source)\norg.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)\norg.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1367)\norg.hibernate.internal.SessionImpl.scroll(SessionImpl.java:1592)\norg.hibernate.query.internal.AbstractProducedQuery.doScroll(AbstractProducedQuery.java:1588)\norg.hibernate.query.internal.AbstractProducedQuery.scroll(AbstractProducedQuery.java:1574)\norg.hibernate.query.internal.AbstractProducedQuery.stream(AbstractProducedQuery.java:1598)\norg.hibernate.query.Query.getResultStream(Query.java:1140)\norg.keycloak.models.jpa.JpaRealmProvider.getClientScopes(JpaRealmProvider.java:926)\norg.keycloak.storage.ClientStorageManager.getClientScopes(ClientStorageManager.java:207)\norg.keycloak.models.cache.infinispan.RealmCacheSession.getClientScopes(RealmCacheSession.java:1341)\norg.keycloak.models.jpa.ClientAdapter.getClientScopes(ClientAdapter.java:366)\norg.keycloak.models.cache.infinispan.entities.CachedClient.<init>(CachedClient.java:116)\norg.keycloak.models.cache.infinispan.RealmCacheSession.cacheClient(RealmCacheSession.java:1138)\norg.keycloak.models.cache.infinispan.RealmCacheSession.getClientById(RealmCacheSession.java:1100)\norg.keycloak.models.jpa.RealmAdapter.getMasterAdminClient(RealmAdapter.java:1169)\norg.keycloak.models.cache.infinispan.entities.CachedRealm.<init>(CachedRealm.java:267)\norg.keycloak.models.cache.infinispan.RealmCacheSession.getRealm(RealmCacheSession.java:414)\norg.keycloak.models.jpa.JpaRealmProvider$$Lambda$1102/0x0000000800b9e040.apply(Unknown Source)\njava.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\njava.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)\njava.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)\njava.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)\njava.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)\njava.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\njava.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)\norg.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)\norg.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)\norg.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider.removeAllExpired(InfinispanUserSessionProvider.java:601)\norg.keycloak.services.scheduled.ClearExpiredUserSessions.run(ClearExpiredUserSessions.java:39)\norg.keycloak.services.scheduled.ScheduledTaskRunner.runTask(ScheduledTaskRunner.java:74)\norg.keycloak.services.scheduled.ScheduledTaskRunner.run(ScheduledTaskRunner.java:55)\norg.keycloak.timer.basic.BasicTimerProvider$1.run(BasicTimerProvider.java:53)\njava.base@11.0.15/java.util.TimerThread.mainLoop(Timer.java:556)\njava.base@11.0.15/java.util.TimerThread.run(Timer.java:506)\n","threadName":"Transaction Reaper Worker 0","threadId":44,"mdc":{},"ndc":"","hostName":"mykeycloakhost-aw-us-1","processName":"QuarkusEntryPoint","processId":1}
{"timestamp":"2022-08-11T22:48:07.224Z","sequence":8612,"loggerClassName":"com.arjuna.ats.arjuna.logging.arjunaI18NLogger_$logger","loggerName":"com.arjuna.ats.arjuna","level":"INFO","message":"ARJUNA012404: Action id 0:ffff0a0093a0:8a8f:62f511f7:44da2 - thread Timer-0 at time 22:47:37.219 had stackTrace java.base@11.0.15/java.util.HashMap.hash(HashMap.java:340)\njava.base@11.0.15/java.util.HashMap.containsKey(HashMap.java:592)\njava.base@11.0.15/java.util.LinkedHashMap$LinkedKeySet.contains(LinkedHashMap.java:545)\njava.base@11.0.15/java.util.Collections$UnmodifiableCollection.contains(Collections.java:1036)\njava.base@11.0.15/java.util.Collections$UnmodifiableCollection.contains(Collections.java:1036)\norg.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.isLazyAttribute(LazyAttributeLoadingInterceptor.java:124)\norg.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.isAttributeLoaded(LazyAttributeLoadingInterceptor.java:120)\norg.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.handleRead(LazyAttributeLoadingInterceptor.java:53)\norg.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor.readObject(AbstractInterceptor.java:153)\norg.keycloak.models.jpa.entities.ProtocolMapperEntity.$$_hibernate_read_id(ProtocolMapperEntity.java)\norg.keycloak.models.jpa.entities.ProtocolMapperEntity.getId(ProtocolMapperEntity.java:70)\njdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)\njava.base@11.0.15/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.base@11.0.15/java.lang.reflect.Method.invoke(Method.java:566)\norg.hibernate.property.access.spi.GetterMethodImpl.get(GetterMethodImpl.java:42)\norg.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:230)\norg.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:5280)\norg.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:74)\norg.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:203)\norg.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:162)\norg.hibernate.event.internal.AbstractFlushingEventListener$$Lambda$1164/0x0000000800bed840.accept(Unknown Source)\norg.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)\norg.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:229)\norg.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:93)\norg.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:50)\norg.hibernate.internal.SessionImpl$$Lambda$1097/0x0000000800b9fc40.accept(Unknown Source)\norg.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)\norg.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1367)\norg.hibernate.internal.SessionImpl.executeUpdate(SessionImpl.java:1471)\norg.hibernate.query.internal.AbstractProducedQuery.doExecuteUpdate(AbstractProducedQuery.java:1714)\norg.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1696)\norg.keycloak.models.jpa.session.JpaUserSessionPersisterProvider.removeExpired(JpaUserSessionPersisterProvider.java:251)\norg.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider.removeExpired(InfinispanUserSessionProvider.java:608)\norg.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider$$Lambda$1617/0x0000000800ec3c40.accept(Unknown Source)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)\njava.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\njava.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\njava.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)\njava.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\njava.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)\njava.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)\njava.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)\njava.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)\njava.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\njava.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)\norg.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)\norg.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)\norg.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider.removeAllExpired(InfinispanUserSessionProvider.java:601)\norg.keycloak.services.scheduled.ClearExpiredUserSessions.run(ClearExpiredUserSessions.java:39)\norg.keycloak.services.scheduled.ScheduledTaskRunner.runTask(ScheduledTaskRunner.java:74)\norg.keycloak.services.scheduled.ScheduledTaskRunner.run(ScheduledTaskRunner.java:55)\norg.keycloak.timer.basic.BasicTimerProvider$1.run(BasicTimerProvider.java:53)\njava.base@11.0.15/java.util.TimerThread.mainLoop(Timer.java:556)\njava.base@11.0.15/java.util.TimerThread.run(Timer.java:506)\n","threadName":"Transaction Reaper Worker 0","threadId":44,"mdc":{},"ndc":"","hostName":"mykeycloakhost-aw-us-1","processName":"QuarkusEntryPoint","processId":1}
{"timestamp":"2022-08-11T22:48:07.225Z","sequence":8613,"loggerClassName":"com.arjuna.ats.arjuna.logging.arjunaI18NLogger_$logger","loggerName":"com.arjuna.ats.arjuna","level":"WARN","message":"ARJUNA012095: Abort of action id 0:ffff0a0093a0:8a8f:62f511f7:44da2 invoked while multiple threads active within it.","threadName":"Transaction Reaper Worker 0","threadId":44,"mdc":{},"ndc":"","hostName":"mykeycloakhost-aw-us-1","processName":"QuarkusEntryPoint","processId":1}
{"timestamp":"2022-08-11T22:48:07.226Z","sequence":8614,"loggerClassName":"com.arjuna.ats.arjuna.logging.arjunaI18NLogger_$logger","loggerName":"com.arjuna.ats.arjuna","level":"WARN","message":"ARJUNA012381: Action id 0:ffff0a0093a0:8a8f:62f511f7:44da2 completed with multiple threads - thread Timer-0 was in progress with org.hibernate.engine.internal.EntityEntryContext.getAssociatedManagedEntity(EntityEntryContext.java:155)\norg.hibernate.engine.internal.EntityEntryContext.getEntityEntry(EntityEntryContext.java:224)\norg.hibernate.engine.internal.StatefulPersistenceContext.getEntry(StatefulPersistenceContext.java:463)\norg.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:94)\norg.hibernate.internal.SessionImpl$$Lambda$1162/0x0000000800bee040.applyEventToListener(Unknown Source)\norg.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:118)\norg.hibernate.internal.SessionImpl.persistOnFlush(SessionImpl.java:805)\norg.hibernate.engine.spi.CascadingActions$8.cascade(CascadingActions.java:341)\norg.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:510)\norg.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:434)\norg.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:220)\norg.hibernate.engine.internal.Cascade.cascadeCollectionElements(Cascade.java:543)\norg.hibernate.engine.internal.Cascade.cascadeCollection(Cascade.java:474)\norg.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:437)\norg.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:220)\norg.hibernate.engine.internal.Cascade.cascade(Cascade.java:153)\norg.hibernate.event.internal.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:159)\norg.hibernate.event.internal.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:149)\norg.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:82)\norg.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)\norg.hibernate.internal.SessionImpl$$Lambda$1108/0x0000000800b9c840.accept(Unknown Source)\norg.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)\norg.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1402)\norg.hibernate.internal.SessionImpl.flush(SessionImpl.java:1389)\norg.hibernate.query.internal.NativeQueryImpl.beforeQuery(NativeQueryImpl.java:268)\norg.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1694)\norg.keycloak.models.jpa.session.JpaUserSessionPersisterProvider.removeExpired(JpaUserSessionPersisterProvider.java:245)\norg.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider.removeExpired(InfinispanUserSessionProvider.java:608)\norg.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider$$Lambda$1617/0x0000000800ec3c40.accept(Unknown Source)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)\njava.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\njava.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\njava.base@11.0.15/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)\njava.base@11.0.15/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\njava.base@11.0.15/java.util.Iterator.forEachRemaining(Iterator.java:133)\njava.base@11.0.15/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)\njava.base@11.0.15/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)\njava.base@11.0.15/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)\njava.base@11.0.15/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)\njava.base@11.0.15/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\njava.base@11.0.15/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)\norg.hibernate.query.spi.StreamDecorator.forEach(StreamDecorator.java:153)\norg.keycloak.utils.ClosingStream.forEach(ClosingStream.java:128)\norg.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider.removeAllExpired(InfinispanUserSessionProvider.java:601)\norg.keycloak.services.scheduled.ClearExpiredUserSessions.run(ClearExpiredUserSessions.java:39)\norg.keycloak.services.scheduled.ScheduledTaskRunner.runTask(ScheduledTaskRunner.java:74)\norg.keycloak.services.scheduled.ScheduledTaskRunner.run(ScheduledTaskRunner.java:55)\norg.keycloak.timer.basic.BasicTimerProvider$1.run(BasicTimerProvider.java:53)\njava.base@11.0.15/java.util.TimerThread.mainLoop(Timer.java:556)\njava.base@11.0.15/java.util.TimerThread.run(Timer.java:506)\n","threadName":"Transaction Reaper Worker 0","threadId":44,"mdc":{},"ndc":"","hostName":"mykeycloakhost-aw-us-1","processName":"QuarkusEntryPoint","processId":1}
{"timestamp":"2022-08-11T22:48:07.227Z","sequence":8615,"loggerClassName":"com.arjuna.ats.arjuna.logging.arjunaI18NLogger_$logger","loggerName":"com.arjuna.ats.arjuna","level":"WARN","message":"ARJUNA012108: CheckedAction::check - atomic action 0:ffff0a0093a0:8a8f:62f511f7:44da2 aborting with 1 threads active!","threadName":"Transaction Reaper Worker 0","threadId":44,"mdc":{},"ndc":"","hostName":"mykeycloakhost-aw-us-1","processName":"QuarkusEntryPoint","processId":1}
{"timestamp":"2022-08-11T22:48:07.23Z","sequence":8616,"loggerClassName":"org.jboss.logging.Logger","loggerName":"io.agroal.pool","level":"WARN","message":"Datasource '<default>': JDBC resources leaked: 1 ResultSet(s) and 1 Statement(s)","threadName":"Transaction Reaper Worker 0","threadId":44,"mdc":{},"ndc":"","hostName":"mykeycloakhost-aw-us-1","processName":"QuarkusEntryPoint","processId":1}

and errors like

{"timestamp":"2022-08-11T22:48:07.256Z","sequence":8619,"loggerClassName":"org.keycloak.services.ServicesLogger_$logger","loggerName":"org.keycloak.services","level":"ERROR","message":"KC-SERVICES0089: Failed to run scheduled task ClearExpiredUserSessions","threadName":"Timer-0","threadId":18,"mdc":{},"ndc":"","hostName":"mykeycloakhost-aw-us-1","processName":"QuarkusEntryPoint","processId":1,"exception":{"refId":1,"exceptionType":"javax.persistence.PersistenceException","message":"org.hibernate.HibernateException: Transaction was rolled back in a different thread!","frames":[{"class":"org.hibernate.internal.ExceptionConverterImpl","method":"convert","line":154},{"class":"org.hibernate.internal.ExceptionConverterImpl","method":"convert","line":181},{"class":"org.hibernate.internal.ExceptionConverterImpl","method":"convert","line":188},{"class":"org.hibernate.internal.SessionImpl","method":"doFlush","line":1406},{"class":"org.hibernate.internal.SessionImpl","method":"flush","line":1389},{"class":"org.hibernate.query.internal.NativeQueryImpl","method":"beforeQuery","line":268},{"class":"org.hibernate.query.internal.AbstractProducedQuery","method":"executeUpdate","line":1694},{"class":"org.keycloak.models.jpa.session.JpaUserSessionPersisterProvider","method":"removeExpired","line":245},{"class":"org.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider","method":"removeExpired","line":608},{"class":"java.util.stream.ForEachOps$ForEachOp$OfRef","method":"accept","line":183},{"class":"java.util.stream.ReferencePipeline$3$1","method":"accept","line":195},{"class":"java.util.stream.ReferencePipeline$3$1","method":"accept","line":195},{"class":"java.util.stream.ReferencePipeline$2$1","method":"accept","line":177},{"class":"java.util.stream.ReferencePipeline$3$1","method":"accept","line":195},{"class":"java.util.Iterator","method":"forEachRemaining","line":133},{"class":"java.util.Spliterators$IteratorSpliterator","method":"forEachRemaining","line":1801},{"class":"java.util.stream.AbstractPipeline","method":"copyInto","line":484},{"class":"java.util.stream.AbstractPipeline","method":"wrapAndCopyInto","line":474},{"class":"java.util.stream.ForEachOps$ForEachOp","method":"evaluateSequential","line":150},{"class":"java.util.stream.ForEachOps$ForEachOp$OfRef","method":"evaluateSequential","line":173},{"class":"java.util.stream.AbstractPipeline","method":"evaluate","line":234},{"class":"java.util.stream.ReferencePipeline","method":"forEach","line":497},{"class":"org.hibernate.query.spi.StreamDecorator","method":"forEach","line":153},{"class":"org.keycloak.utils.ClosingStream","method":"forEach","line":128},{"class":"org.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider","method":"removeAllExpired","line":601},{"class":"org.keycloak.services.scheduled.ClearExpiredUserSessions","method":"run","line":39},{"class":"org.keycloak.services.scheduled.ScheduledTaskRunner","method":"runTask","line":74},{"class":"org.keycloak.services.scheduled.ScheduledTaskRunner","method":"run","line":55},{"class":"org.keycloak.timer.basic.BasicTimerProvider$1","method":"run","line":53},{"class":"java.util.TimerThread","method":"mainLoop","line":556},{"class":"java.util.TimerThread","method":"run","line":506}],"causedBy":{"exception":{"refId":2,"exceptionType":"org.hibernate.HibernateException","message":"Transaction was rolled back in a different thread!","frames":[{"class":"org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorTrackingImpl","method":"processAnyDelayedAfterCompletion","line":90},{"class":"org.hibernate.internal.SessionImpl","method":"delayedAfterCompletion","line":636},{"class":"org.hibernate.internal.SessionImpl","method":"persistOnFlush","line":806},{"class":"org.hibernate.engine.spi.CascadingActions$8","method":"cascade","line":341},{"class":"org.hibernate.engine.internal.Cascade","method":"cascadeToOne","line":510},{"class":"org.hibernate.engine.internal.Cascade","method":"cascadeAssociation","line":434},{"class":"org.hibernate.engine.internal.Cascade","method":"cascadeProperty","line":220},{"class":"org.hibernate.engine.internal.Cascade","method":"cascadeCollectionElements","line":543},{"class":"org.hibernate.engine.internal.Cascade","method":"cascadeCollection","line":474},{"class":"org.hibernate.engine.internal.Cascade","method":"cascadeAssociation","line":437},{"class":"org.hibernate.engine.internal.Cascade","method":"cascadeProperty","line":220},{"class":"org.hibernate.engine.internal.Cascade","method":"cascade","line":153},{"class":"org.hibernate.event.internal.AbstractFlushingEventListener","method":"cascadeOnFlush","line":159},{"class":"org.hibernate.event.internal.AbstractFlushingEventListener","method":"prepareEntityFlushes","line":149},{"class":"org.hibernate.event.internal.AbstractFlushingEventListener","method":"flushEverythingToExecutions","line":82},{"class":"org.hibernate.event.internal.DefaultFlushEventListener","method":"onFlush","line":39},{"class":"org.hibernate.event.service.internal.EventListenerGroupImpl","method":"fireEventOnEachListener","line":107},{"class":"org.hibernate.internal.SessionImpl","method":"doFlush","line":1402},{"class":"org.hibernate.internal.SessionImpl","method":"flush","line":1389},{"class":"org.hibernate.query.internal.NativeQueryImpl","method":"beforeQuery","line":268},{"class":"org.hibernate.query.internal.AbstractProducedQuery","method":"executeUpdate","line":1694},{"class":"org.keycloak.models.jpa.session.JpaUserSessionPersisterProvider","method":"removeExpired","line":245},{"class":"org.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider","method":"removeExpired","line":608},{"class":"java.util.stream.ForEachOps$ForEachOp$OfRef","method":"accept","line":183},{"class":"java.util.stream.ReferencePipeline$3$1","method":"accept","line":195},{"class":"java.util.stream.ReferencePipeline$3$1","method":"accept","line":195},{"class":"java.util.stream.ReferencePipeline$2$1","method":"accept","line":177},{"class":"java.util.stream.ReferencePipeline$3$1","method":"accept","line":195},{"class":"java.util.Iterator","method":"forEachRemaining","line":133},{"class":"java.util.Spliterators$IteratorSpliterator","method":"forEachRemaining","line":1801},{"class":"java.util.stream.AbstractPipeline","method":"copyInto","line":484},{"class":"java.util.stream.AbstractPipeline","method":"wrapAndCopyInto","line":474},{"class":"java.util.stream.ForEachOps$ForEachOp","method":"evaluateSequential","line":150},{"class":"java.util.stream.ForEachOps$ForEachOp$OfRef","method":"evaluateSequential","line":173},{"class":"java.util.stream.AbstractPipeline","method":"evaluate","line":234},{"class":"java.util.stream.ReferencePipeline","method":"forEach","line":497},{"class":"org.hibernate.query.spi.StreamDecorator","method":"forEach","line":153},{"class":"org.keycloak.utils.ClosingStream","method":"forEach","line":128},{"class":"org.keycloak.models.sessions.infinispan.InfinispanUserSessionProvider","method":"removeAllExpired","line":601},{"class":"org.keycloak.services.scheduled.ClearExpiredUserSessions","method":"run","line":39},{"class":"org.keycloak.services.scheduled.ScheduledTaskRunner","method":"runTask","line":74},{"class":"org.keycloak.services.scheduled.ScheduledTaskRunner","method":"run","line":55},{"class":"org.keycloak.timer.basic.BasicTimerProvider$1","method":"run","line":53},{"class":"java.util.TimerThread","method":"mainLoop","line":556},{"class":"java.util.TimerThread","method":"run","line":506}]}}}}

any idea when these occurs and how to resolve them?
these are mostly seen when i have about 500+ realms and i try to do some activity like create realm/delete ream, search user client roles etc…

1 Like

Hi @kkcmadhu, did you get any route cause and solution to these errors?