The JmsConnectionPool test for whether to create a new transactional session does not take into account an expired transaction.
Issue
We have the following use case:
Service A calls Service B via a StaticRouter
. Both services are fully transactional. Both use XAConnectionFactories
and JMS-JCA
providers. No InVM
used at all.
Service A and B contain a wait action. This action is used to provoke a transaction timeout. The DB insert action in service_a
is used to verify the transaction behavior.
Test case 1:
Wait_time service_a = 0 sec
Wait_time service_b = 0 sec.
Database insert active
I can see that if the call happens within the active transaction the static router calls the Service B within a transactional context. Everything is fine. (wait_time < tx_timeout
). Service_b
is called successfully within a transaction.
Test case 2:
Wait_time service_a = 11 sec
Wait_time service_b = 0 sec.
Database insert active.
We set the wait_time
higher then the transaction timeout. I can see that after the wait action a database persister action tries to insert something into the database. This fails because there is no active transaction. Pipeline is aborted. Again everything is fine/as expected.
Test case 3:
Wait_time service_a = 11 sec
Wait_time service_b = 0 sec.
Database insert inactive.
We set the wait_time
again higher then the transaction timeout, but deactivate the DB insert. I can see
- that after the wait action the TX manager does a rollback, because of the transaction timeout.
- This time the pipeline is not aborted, it continues. The log file shows the log statements from the second service.
- It creates a new transaction.
It seems that service invoker which is used internally by the static router is creating a new transaction. From my understanding this should not happen. Can you confirm?
Environment
- Red Hat JBoss SOA Platform 5
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.