Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » joinTransaction() opens transaction?(bug in eclipselink/geronimo)
joinTransaction() opens transaction? [message #1778919] Sun, 24 December 2017 08:24 Go to next message
Wolfgang Winter is currently offline Wolfgang WinterFriend
Messages: 4
Registered: December 2017
Junior Member
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] Wed, 28 March 2018 02:38 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
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: Wed, 28 March 2018 02:39]

Report message to a moderator

Re: joinTransaction() opens transaction? [message #1786821 is a reply to message #1784441] Sun, 13 May 2018 11:15 Go to previous messageGo to next message
Wolfgang Winter is currently offline Wolfgang WinterFriend
Messages: 4
Registered: December 2017
Junior Member
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 14:54 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
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 15:04]

Report message to a 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: Sat Apr 20 00:09:08 GMT 2024

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

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

Back to the top