[ 
https://issues.apache.org/jira/browse/CAMEL-23234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069053#comment-18069053
 ] 

Cameron Fitzwater commented on CAMEL-23234:
-------------------------------------------

I've tested this using the 4.19.0 snapshot override for camel-jta and the 
behavior is MOSTLY successful. However, there is still an instance where 
transactions are being committed.

 
Within transacted(), if you perform a database action (basic insert or 
something), then perform a long delay action, something like 90s (above the JTA 
limit default of 60s), and kill the running container right after a calling the 
route, transactions are still committed.
_This is mock an instance of where a longer running process was inflight but a 
container got a SIGKIL during that time. I also say kill it right away because 
you want the grace (45s) to run out prior to the JTA timeout (60s)._
 
{{2026-03-27 16:54:44,416 INFO  
[org.apache.camel.impl.engine.AbstractCamelContext] (main) Apache Camel 4.18.0 
(camel-1) is shutting down (timeout:45s)}}
{{2026-03-27 16:54:44,440 INFO  
[org.apache.camel.impl.engine.DefaultShutdownStrategy] (Camel (camel-1) thread 
#1 - ShutdownTask) Waiting as there are still 2 inflight and pending exchanges 
to complete, timeout in 45 seconds. Inflights per route: [getPnodesDbTx = 1, 
getPnodes = 1]}}
{{2026-03-27 16:54:45,453 INFO  
[org.apache.camel.impl.engine.DefaultShutdownStrategy] (Camel (camel-1) thread 
#1 - ShutdownTask) Waiting as there are still 2 inflight and pending exchanges 
to complete, timeout in 44 seconds. Inflights per route: [getPnodesDbTx = 1, 
getPnodes = 1]}}
{{...
2026-03-27 16:55:28,567 INFO  
[org.apache.camel.impl.engine.DefaultShutdownStrategy] (Camel (camel-1) thread 
#1 - ShutdownTask) Waiting as there are still 2 inflight and pending exchanges 
to complete, timeout in 1 seconds. Inflights per route: [getPnodesDbTx = 1, 
getPnodes = 1]
2026-03-27 16:55:29,422 WARN  
[org.apache.camel.impl.engine.DefaultShutdownStrategy] (Camel (camel-1) thread 
#1 - ShutdownTask) Interrupted while waiting during graceful shutdown, will 
force shutdown now.
2026-03-27 16:55:29,422 WARN  
[org.apache.camel.impl.engine.DefaultShutdownStrategy] (main) Timeout occurred 
during graceful shutdown. Forcing the routes to be shutdown now. Notice: some 
resources may still be running as graceful shutdown did not complete 
successfully.
2026-03-27 16:55:29,479 INFO  
[org.apache.camel.impl.engine.AbstractCamelContext] (main) Routes stopped 
(total:51 rest-dsl:12 forced:51)}}
{{...
2026-03-27 16:55:39,513 INFO  [io.quarkus.thread-pool] (main) Awaiting thread 
pool shutdown; 1 thread(s) running
2026-03-27 16:55:39,514 ERROR 
[io.quarkus.narayana.jta.runtime.NotifyingTransactionManager] 
(executor-thread-1) Failed to fire @BeforeDestroyed(TransactionScoped.class) 
[Error Occurred After Shutdown]: java.lang.NullPointerException: Cannot invoke 
"io.quarkus.arc.ArcContainer.beanManager()" because the return value of 
"io.quarkus.arc.Arc.container()" is null
...}}
{{2026-03-27 16:55:39,517 WARN  [com.arjuna.ats.jta] (executor-thread-1) 
ARJUNA016045: attempted rollback of < formatId=131077, gtrid_length=35, 
bqual_length=36, tx_uid=0:ffffac110002:882f:69c6b653:0, node_name=quarkus, 
branch_uid=0:ffffac110002:882f:69c6b653:2, subordinatenodename=null, eis_name=0 
> (io.agroal.narayana.LocalXAResource@423a75cb) failed with exception code 
XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to 
transactionRollback local transaction: ORA-17008: Closed connection}}
{{}}

> camel transacted committing on rollback
> ---------------------------------------
>
>                 Key: CAMEL-23234
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23234
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 4.18.0
>            Reporter: Cameron Fitzwater
>            Assignee: Federico Mariani
>            Priority: Major
>             Fix For: 4.19.0
>
>
> *Issue:*
> The issue is that at the moment when a forced shutdown occurs while a 
> transacted route is in-flight, the TransactionErrorHandler does not mark the 
> exchange for rollback before the connection pool is destroyed, 
> {color:#FF0000}allowing the database to auto-commit partial work.{color}
>  
> *Chat:*
> https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/Testing.20Transacted.20Component/with/579766086



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to