Oracle + flowable + hikari = db session hangs

I have the following setup:

JDK 8 (Temurin)
Spring 4.3.30
Flowable 6.7.0
Oracle 19c
HikariCP 2.4.13
Oracle JDBC 23.5.0.24.07
JBoss EAP 6.4

Sometimes, when I try to run some flowable operations (e.g. change activity), the DB session will be stuck up to a few hours and will eventually crash the server.

Here is the code to perform change activity:

   RuntimeServiceImpl aaa = (RuntimeServiceImpl) runtimeService;

            ChangeActivityStateBuilder casb = new ChangeActivityStateBuilderImpl(aaa);

            casb.processInstanceId(processInstanceId);
            casb.moveActivityIdTo(taskDefinitionId, targetTaskId);

            casb.changeState();

Here is a sample stack trace:

java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
        at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
        at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
        - locked <0x000000069408a110> (a sun.nio.ch.Util$3)
        - locked <0x000000069408a100> (a java.util.Collections$UnmodifiableSet)
        - locked <0x0000000694089f18> (a sun.nio.ch.EPollSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:101)
        at oracle.net.nt.TimeoutSocketChannel.doSelect(TimeoutSocketChannel.java:695)
        at oracle.net.nt.TimeoutSocketChannel.doSelectForRead(TimeoutSocketChannel.java:599)
        at oracle.net.nt.TimeoutSocketChannel.read(TimeoutSocketChannel.java:501)
        at oracle.net.ns.NSProtocolNIO.doSocketRead(NSProtocolNIO.java:1222)
        at oracle.net.ns.NIOPacket.readHeader(NIOPacket.java:271)
        at oracle.net.ns.NIOPacket.readPacketFromSocketChannel(NIOPacket.java:204)
        at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:147)
        at oracle.net.ns.NIOPacket.readFromSocketChannel(NIOPacket.java:120)
        at oracle.net.ns.NIONSDataChannel.readDataFromSocketChannel(NIONSDataChannel.java:104)
        at oracle.jdbc.driver.T4CMAREngineNIO.prepareForUnmarshall(T4CMAREngineNIO.java:875)
        at oracle.jdbc.driver.T4CMAREngineNIO.unmarshalUB1(T4CMAREngineNIO.java:446)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:888)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:443)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:518)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:251)

Here is the server log that shows the time it took to run the update statement on ACT_HI_TASKINST took almost 2 hours:

14:01:56,971 DEBUG [org.flowable.common.engine.impl.db.DbSqlSession:573] (194AAA) updating: HistoricTaskInstanceEntity[id=28052840]
14:01:56,972 DEBUG [org.flowable.task.service.impl.persistence.entity.HistoricTaskInstanceEntityImpl.updateHistoricTaskInstance:137] (194AAA) ==>  Preparing: update ACT_HI_TASKINST SET REV_ = ?, END_TIME_ = ?, DURATION_ = ?, DELETE_REASON_ = ?, LAST_UPDATED_TIME_ = ? where ID_ = ? and REV_ = ?
14:01:56,972 TRACE [org.springframework.transaction.support.TransactionSynchronizationManager:140] (194AAA) Retrieved value [org.springframework.jdbc.datasource.ConnectionHolder@b4c96f1] for key [HikariDataSource (HikariPool-1)] bound to thread [194AAA]
14:01:56,972 DEBUG [org.flowable.task.service.impl.persistence.entity.HistoricTaskInstanceEntityImpl.updateHistoricTaskInstance:137] (194AAA) ==> Parameters: 2(Integer), 2024-09-17 14:01:56.943(Timestamp), 621761235(Long), Change activity to sid-BE6607FA-DF73-4E19-808E-F7095F6ED667(String), 2024-09-17 14:01:56.943(Timestamp), 28052840(String), 1(Integer)
15:48:11,167 DEBUG [org.flowable.task.service.impl.persistence.entity.HistoricTaskInstanceEntityImpl.updateHistoricTaskInstance:137] (194AAA) <==    Updates: 1

was just wondering if anyone faced the same issue and if they have any advice would be much appreciated