[
https://issues.apache.org/jira/browse/GEODE-8483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17192489#comment-17192489
]
ASF GitHub Bot commented on GEODE-8483:
---------------------------------------
boglesby opened a new pull request #5498:
URL: https://github.com/apache/geode/pull/5498
Note: This change was tested using the websphere-liberty docker image.
Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced in
the commit message?
- [ ] Has your PR been rebased against the latest commit within the target
branch (typically `develop`)?
- [ ] Is your initial contribution a single, squashed commit?
- [ ] Does `gradlew build` run cleanly?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
### Note:
Please ensure that once the PR is submitted, check Concourse for build
issues and
submit an update to your PR as soon as possible. If you need help, please
send an
email to [email protected].
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Geode JCALocalTransaction fails to begin a JTA last resource transaction if
> the TransactionManager is not bound into JNDI
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: GEODE-8483
> URL: https://issues.apache.org/jira/browse/GEODE-8483
> Project: Geode
> Issue Type: Bug
> Components: transactions
> Reporter: Barrett Oglesby
> Assignee: Barrett Oglesby
> Priority: Major
>
> The exception is:
> {noformat}
> [error 2020/08/18 22:57:03.997 UTC <Default Executor-thread-4> tid=0x20]
> Application run failed
> Caused by: org.springframework.transaction.TransactionSystemException:
> UOWManager transaction processing failed; nested exception is
> com.ibm.wsspi.uow.UOWException: javax.transaction.HeuristicMixedException
> at
> org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:313)
> at example.jta.client.Client.iterateAndCreateTrades(Client.java:93)
> at example.jta.client.Client.loadEntries(Client.java:74)
> Caused by: com.ibm.wsspi.uow.UOWException:
> javax.transaction.HeuristicMixedException
> at
> com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:757)
> at
> com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:329)
> at
> org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:306)
> Caused by: javax.transaction.HeuristicMixedException
> at com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:715)
> at com.ibm.tx.jta.impl.TranManagerImpl.commit(TranManagerImpl.java:165)
> at com.ibm.tx.jta.impl.TranManagerSet.commit(TranManagerSet.java:113)
> at
> com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.uowCommit(EmbeddableUOWManagerImpl.java:834)
> at
> com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.uowEnd(EmbeddableUOWManagerImpl.java:812)
> at
> com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:754)
> Caused by: javax.transaction.xa.XAException
> at
> com.ibm.ejs.j2c.LocalTransactionWrapper.commit(LocalTransactionWrapper.java:157)
> at
> com.ibm.tx.jta.impl.OnePhaseResourceImpl.commit_one_phase(OnePhaseResourceImpl.java:113)
> at
> com.ibm.tx.jta.impl.RegisteredResources.flowCommitOnePhase(RegisteredResources.java:2045)
> at
> com.ibm.tx.jta.impl.TransactionImpl.commitXAResources(TransactionImpl.java:1478)
> at
> com.ibm.tx.jta.impl.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:801)
> at
> com.ibm.tx.jta.impl.TransactionImpl.processCommit(TransactionImpl.java:768)
> at com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:711)
> Caused by: javax.resource.spi.LocalTransactionException:
> java.lang.IllegalStateException: Thread does not have an active transaction
> at
> org.apache.geode.internal.ra.spi.JCALocalTransaction.commit(JCALocalTransaction.java:116)
> at
> com.ibm.ejs.j2c.LocalTransactionWrapper.commit(LocalTransactionWrapper.java:145)
> {noformat}
> Here is a truncated version of {{JCALocalTransaction.begin}}:
> {noformat}
> public void begin() throws ResourceException {
> TransactionManager tm = this.cache.getJTATransactionManager();
> if (tm != null && tm.getTransaction() != null) {
> this.gfTxMgr.begin();
> } else {
> if (logger.fineEnabled()) {
> logger.fine("JCAManagedConnection: JTA Transaction does not exist.");
> }
> }
> }
> {noformat}
> It attempts to get the {{TransactionManager}} (which in this case is a
> {{com.ibm.tx.jta.embeddable.impl.EmbeddableTranManagerSet}}). If it is null
> (not bound) or it doesn't have a {{Transaction}} in progress, it logs a
> message at fine level and returns.
> A stack trace in {{JCALocalTransaction.begin}} shows the call stack:
> {noformat}
> java.lang.Exception
> at
> org.apache.geode.internal.ra.spi.JCALocalTransaction.begin(JCALocalTransaction.java:54)
> at
> com.ibm.ejs.j2c.LocalTransactionWrapper.start(LocalTransactionWrapper.java:668)
> at
> com.ibm.ws.Transaction.JTA.JTAResourceBase.start(JTAResourceBase.java:121)
> at
> com.ibm.tx.jta.impl.RegisteredResources.startRes(RegisteredResources.java:835)
> at
> com.ibm.tx.jta.impl.RegisteredResources.enlistResource(RegisteredResources.java:289)
> at
> com.ibm.tx.jta.impl.TransactionImpl.enlistResource(TransactionImpl.java:1991)
> at
> com.ibm.tx.jta.embeddable.impl.EmbeddableTranManagerSet.enlistOnePhase(EmbeddableTranManagerSet.java:184)
> at
> com.ibm.ws.transaction.services.TransactionManagerService.enlistOnePhase(TransactionManagerService.java:366)
> at
> com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:412)
> at
> com.ibm.ejs.j2c.ConnectionManager.initializeForUOW(ConnectionManager.java:1037)
> at
> com.ibm.ejs.j2c.ConnectionManager.involveMCInTran(ConnectionManager.java:699)
> at
> com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:316)
> at
> org.apache.geode.internal.ra.GFConnectionFactoryImpl.getConnection(GFConnectionFactoryImpl.java:44)
> at
> org.apache.geode.internal.ra.GFConnectionFactoryImpl.getConnection(GFConnectionFactoryImpl.java:25)
> at
> org.springframework.data.gemfire.config.annotation.support.AbstractGemFireAsLastResourceAspectSupport$GemFireConnectionHolder.acquire(AbstractGemFireAsLastResourceAspectSupport.java:525)
> at
> org.springframework.data.gemfire.config.annotation.support.GemFireAsLastResourceConnectionAcquiringAspect.doGemFireConnectionFactoryGetConnection(GemFireAsLastResourceConnectionAcquiringAspect.java:61)
> ...
> at
> org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter.run(WebSphereUowTransactionManager.java:371)
> at
> com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:736)
> at
> com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:329)
> at
> org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:306)
> ...
> at
> example.jta.client.controller.TradeController.iterateAndCreateTrades(TradeController.java:48)
> at
> example.jta.client.controller.TradeController.createTrades(TradeController.java:36)
> {noformat}
> AFAICT, these checks are unnecessary since the {{EmbeddableTranManagerSet}}
> is involved in the call to begin.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)