Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » joinTransaction() opens transaction?(bug in eclipselink/geronimo)
joinTransaction() opens transaction? [message #1778919] Sun, 24 December 2017 03:24 Go to next message
Eclipse UserFriend
Hello,

I have the following code running with eclipselink 2.7 on Tomee 7.0.2 (simplified):
      ut.begin();
      InitialContext context = new InitialContext();
      EntityManagerFactory containerEmf = (EntityManagerFactory) context.lookup("java:comp/env/Cibet");
      EntityManager entityManager = containerEmf.createEntityManager();
      Resource res = new JpaResource();
      entityManager.persist(res);
      ut.commit();

      try {
         entityManager.joinTransaction();
      } catch (TransactionRequiredException e) {
         log.info("... but cannot join transaction: " + e.getMessage());
      }

      ut.begin();

I get this exception on the second ut.begin():
javax.transaction.NotSupportedException: Nested Transactions are not supported
	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:157)
	at org.apache.geronimo.transaction.manager.TransactionManagerImpl.begin(TransactionManagerImpl.java:152)

when I remove the joinTransaction() it works. With Eclipselink 2.4.2 on JPA 2.0 it worked too. It seems to me a bug
Re: joinTransaction() opens transaction? [message #1784441 is a reply to message #1778919] Tue, 27 March 2018 22:38 Go to previous messageGo to next message
Eclipse UserFriend
What server platform class implementation are you using? JoinTransaction just calls txnController.getTransaction() on the external transaction controller specified by the ServerPlatform implementation being used, which I believe this is an implementation set and controlled through Tomee jars.

[Updated on: Tue, 27 March 2018 22:39] by Moderator

Re: joinTransaction() opens transaction? [message #1786821 is a reply to message #1784441] Sun, 13 May 2018 07:15 Go to previous messageGo to next message
Eclipse UserFriend
Hi Chris,
the error could also be observed on Glassfish (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=529320)
I had also problems with the ServerPlatform and property target-server (see https://www.eclipse.org/forums/index.php/t/1090770/
On Glassfish, I set target-server = SunAS9; on Tomee I set to org.apache.openejb.jpa.integration.eclipselink.OpenEJBServerPlatform
See my recommendation here http://www.logitags.com/cibet/faq.html#a9
Re: joinTransaction() opens transaction? [message #1787041 is a reply to message #1786821] Thu, 17 May 2018 10:54 Go to previous message
Eclipse UserFriend
You should show your setup, especially the persistence.xml and datasource to make this occur, and set logging to finest or all to show details on the SQL and transaction behaviour within EclipseLink. JPA EntityManager joinTransaction() method is required to throw TransactionRequiredException if it is called outside of at transaction, are you getting that in your log? If so, show the stack, but as mentioned, if there is a problem with your transaction behaviour in the container, the issue is likely within your container - EclipseLink does not start external transactions.

Edit: checking out the link at http://www.logitags.com/cibet/faq.html#a9 and it seems you've tracked down the issue to this being configured as resource local. If it is resolved, please update the bugs, otherwise update them with the logs and config required to reproduce.

[Updated on: Thu, 17 May 2018 11:04] by Moderator

Previous Topic:JPQL queries that worked in 2.6.4 don't work anymore in 2.7.0
Next Topic:Eclipselink with JTA
Goto Forum:
  


Current Time: Thu Jul 10 01:55:24 EDT 2025

Powered by FUDForum. Page generated in 2.75966 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top