-
15. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
marcanthony Dec 20, 2018 11:07 AM (in response to simkam)Hi Martin
Thank You for the reply, I have already tested the property <property name="hibernate.transaction.flush_before_completion" value="true" /> and it doesn't make any difference, the error is exactly the same. As mentioned above when the execution jumps from ejb to ejb then the transaction seems to be propagated correctly but when it is initialized in the cdi bean and handed over to ejb it gets lost once the ejb method terminates.
Thanks
Marc
-
16. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
tomjenkinson Dec 20, 2018 3:09 PM (in response to alban5650)Is it possible to get a log with trace for org.wildfly.transaction.client, com.arjuna and org.jboss.as.txn when the problem is happening please? You could add it to [WFLY-11543] EJB transactional method unable to commit when invoked from CDI bean with MariaDB - JBoss Issue Tracker if that was OK?
-
17. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
brian.stansberry Dec 20, 2018 3:10 PM (in response to alban5650)The JIRA for this is [WFLY-11543] EJB transactional method unable to commit when invoked from CDI bean with MariaDB - JBoss Issue Tracker
Thank you very much for this report!
-
18. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
marcanthony Dec 20, 2018 4:59 PM (in response to brian.stansberry)Will try to get log also just for completeness I have the problem with MySQL not MariaDB
@RequestScoped public class SomeCDIBean { @Inject @MyEntityManager protected EntityManager entityManager; // datasource A @Inject protected SomeEJBBean facadeBean; // ejb uses datasource B // ------------------------------------------------------------------------- /** */ @Transactional(value = TxType.REQUIRED) public void save() { facadeBean.start(); entityManager.merge(object); //throws java.sql.SQLException: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state } // ------------------------------------------------------------------------- /** */ @Transactional(value = TxType.REQUIRED) public void save() { facadeBean.start(); entityManager.find(entity.class, theId, LockModeType.PESSIMISTIC_WRITE); //throws javax.persistence.TransactionRequiredException: no transaction is in progress } } @RequestScoped public class EntityManagerProducer { @PersistenceUnit(unitName = "unit A") private EntityManagerFactory entityManagerFactory; // ------------------------------------------------------------------------- /** */ public EntityManagerProducer() { /* do nothing */ } // ------------------------------------------------------------------------- /** */ @RequestScoped @MyEntityManager @Produces public EntityManager create() { return entityManagerFactory.createEntityManager(); } // ------------------------------------------------------------------------- /** */ public void dispose(@Disposes @MyEntityManager EntityManager entityManager) { entityManager.close(); } } @Stateless public class SomeEJBBean { @PersistenceContext(unitName = "unit B") private EntityManager entityManager; @TransactionAttribute(TransactionAttributeType.MANDATORY) public void start() { entityManager.persist(object); entityManager.flush(); } }
-
logs.zip 20.8 KB
-
-
19. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
alban5650 Dec 20, 2018 4:56 PM (in response to tomjenkinson)Hi Tom,
I have added the trace file as requested for our application when the error occurs.
It might still be worth for Marc to provide his own trace file as he seems to have a slightly different use case.
-
20. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
marcanthony Dec 20, 2018 5:04 PM (in response to tomjenkinson)Hi Tom
Hopefully the logs are what you asked for attached to thread and JIRA
Thanks
-
21. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
brian.stansberry Dec 20, 2018 6:22 PM (in response to alban5650)So far we have not been able to reproduce this problem, but there's an area about which we have strong suspicions.
If you and/or marcanthony could build a branch and see if the problem still exists, that would be great. The branch is the WFLY-11543_15x branch from my github repo:
GitHub - bstansberry/wildfly at WFLY-11543_15x
That branch is the 15.0.0.Final tag plus commits to address what we suspect is the problem.
-
22. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
kabirkhan Dec 20, 2018 6:49 PM (in response to alban5650)Can you please post proper pseudo-code of exactly what you are trying to do? We are trying hard to reproduce but not having any luck
Never mind, I see some more posts since I last refreshed the page
-
23. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
alban5650 Dec 21, 2018 3:45 AM (in response to brian.stansberry)Hi Brian,
I managed to build your branch and retest the issue.
It's all working now great with MariaDB and also solved a similar issue I had with Oracle at a different part of the application .
Marc,let me know if you want to try the Widfly 15 build I made from Brian's github. Not sure i can post a 31MB file in this forum but otherwise I can find a way to upload it somewhere for you to pickup.
Thank you all for your help and sorry for the lack of code details on my part (Thanks Marc for covering this part)!
Will there be a 15.0.1 release at some point or shall we all wait for next Wildfly 16 release for an official fix?
-
24. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
marcanthony Dec 21, 2018 4:31 AM (in response to alban5650)Hi Alban
Yes that would be great, please let me know details for where I can download
Thanks
-
25. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
marcanthony Dec 21, 2018 4:44 AM (in response to alban5650)Or if you know what libs the changes are in could you share them? Should be smaller enough, assuming it is a few hibernate jars
-
26. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
alban5650 Dec 21, 2018 5:00 AM (in response to marcanthony)Wanted to send you a PM with the download link. I'm not sure how to add you as a contact. I clicked on 'follow you' but you would need to authorise the request before i can send you a message.
-
27. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
kabirkhan Dec 21, 2018 5:16 AM (in response to alban5650)Thanks for the report Alban and Marc. This was a very important find for us as this feeds into other things based on WildFly 15. Also, it is very nice to see community members working together and working things out between themselves!
I don't think there will be a community release of 15.0.1 this side of Christmas/New Year and it isn't really my call whether to do one. But Brian's pull request at https://github.com/wildfly/wildfly/pull/11961 is what contains the fix, so the easiest for now is to rebuild the server as this has been merged to our master branch. Or if you are happy with using Alban's server, a good way to share is via DropBox or Google Drive (or perhaps even via some GitHub repo?).
-
28. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
marcanthony Dec 21, 2018 5:56 AM (in response to kabirkhan)Thanks for all the support
-
29. Re: Issue with transaction/Hibernate persistence and MariaDB in Wildfly 15 Final
kabirkhan Dec 21, 2018 6:03 AM (in response to alban5650)1 of 1 people found this helpfulActually, since you guys have been so good I have pushed up https://github.com/kabir/wildfly/commits/patched-15-final - This is the 15.0.0.Final tag with the three commits from https://github.com/wildfly/wildfly/pull/11961.
I started a custom nightly build #577 (I think this is where you have been downloading from?) which is at https://ci.wildfly.org/viewType.html?buildTypeId=WF_Nightly&branch_WF=patched-15-final%3B%2Fkabir&tab=buildTypeStatusDiv. It builds my branch, so I hope you will be able to download the server from there?