Handling Concurrent Requests in jPOS Participant

38 views
Skip to first unread message

Trịnh Vĩnh Khang

unread,
Oct 22, 2025, 7:06:08 AM (10 days ago) Oct 22
to jPOS Users

I have a problem that I need help with: if two requests enter the same participant, will there be any issue? If one of them calls close or tow of them calls , will it affect the other?
i have a exception "ConcurrentModificationException" in class class="org.jpos.transaction.Close" when two requests in one participant index but other idle. 
Thanks all 

Mark Salter

unread,
Oct 22, 2025, 10:12:56 AM (9 days ago) Oct 22
to jpos-...@googlegroups.com
Can you share the stacktrace, so we can see what is throwing the ConcurrentModificationException and where?

Can you share the source of the Participant or share a link to it?

-- 
Mark

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jpos-users/9278b606-9ad3-4756-96f5-14f571cb70a4n%40googlegroups.com.

signature.asc
Message has been deleted

Trịnh Vĩnh Khang

unread,
Oct 22, 2025, 10:50:45 PM (9 days ago) Oct 22
to jPOS Users
yes i have a exception with hibernate in 

I don’t know whether having two requests come in at the same time like this causes any problems:

=======================================================

TIMESTAMP: Tue Oct 07 03:51:30 GMT 2025

paticipant-9:idle:69397 (java.util.ConcurrentModificationException)
=======================================================

TIMESTAMP: Tue Oct 07 03:51:31 GMT 2025

paticipant-9:idle:69398 (no error).  

=======================================================

</info> *** PANIC - TX not null - RESPONSE OMITTED *** </exception> at java.base/java.lang.Thread.run(Thread.java:840) at org.jpos.transaction.TransactionManager.run(TransactionManager.java:335) at org.jpos.transaction.TransactionManager.commit(TransactionManager.java:531) at org.jpos.transaction.TransactionManager.commit(TransactionManager.java:599) at org.jpos.transaction.Close.commit(Close.java:34) at org.jpos.transaction.Close.closeDB(Close.java:47) at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101) at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:281) at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$300(JdbcResourceLocalTransactionCoordinatorImpl.java:40) at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:183) at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:449) at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2425) at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3290) at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:489) at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1407) at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:40) at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:344) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:475) at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) at org.hibernate.engine.spi.ActionQueue.lambda$executeActions$1(ActionQueue.java:478) at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:602) at java.base/java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1055) at java.base/java.util.ArrayList$Itr.next(ArrayList.java:967) at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013) java.util.ConcurrentModificationException <exception name="null">

Thanks Mark
Vào lúc 21:12:56 UTC+7 ngày Thứ Tư, 22 tháng 10, 2025, Mark Salter đã viết:

Mark Salter

unread,
Oct 23, 2025, 5:47:31 AM (9 days ago) Oct 23
to jpos-...@googlegroups.com
You did not include any detail/source for your Close Participant?

As a brief aside for context/interest...

       For the two transactions that are being processed at the same time...

    •  are they duplicates/identical , or for different cards/transaction types? 
    • anything interesting about the pair?

Hibernate is reporting the failure and perhaps using a single Hibernate Session in two threads could be the issue - hence wondering about the database work for the transactions and if/how they might be colliding at a specific level, or simply if a Session per Transaction is needed - seems likely.


-- 
Mark

signature.asc

Alejandro Revilla

unread,
Oct 23, 2025, 8:43:12 AM (9 days ago) Oct 23
to jpos-...@googlegroups.com
This logs are difficult to read, but based on what you say, I believe your problem could be related to this:

   https://jpos.org/blog/2020/09/badsharedmemories



Reply all
Reply to author
Forward
0 new messages