Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARJUNA017003 when using nested @Transactional(REQUIRES_NEW) in CdiJpaTest #49

Open
duschata opened this issue Jan 25, 2022 · 1 comment

Comments

@duschata
Copy link

Hello All,
I've modified org.hibernate.demos.jpacditesting.CdiJpaTest a litte bit and I get an ARJUNA017003 Exception:

checking transaction and found that this connection is already associated with a different transaction! Obtain a new connection for this transaction.

https://github.com/duschata/hibernate-demos/blob/ARJUNA017003/other/cdi-jpa-testing/src/test/java/org/hibernate/demos/jpacditesting/CdiJpaTest.java#L156-L184

Works this as expected or is this a bug? How can I test my services which are annotated with REQUIRES_NEW?

Kind Regards
Tom

@alexxismachine
Copy link

Even when I'm a little late at the party, I had the same problem.

I found https://developer.jboss.org/thread/280419 suggesting to use @TransactionScoped for the EntityManager produce method and it works for me.

Maybe you also need to set the isolation level. I did that in the getConnection method of the TransactionalConnectionProvider with e.g.
com.arjuna.ats.jdbc.common.jdbcPropertyManager.getJDBCEnvironmentBean().setIsolationLevel( Connection.TRANSACTION_READ_COMMITTED);

Cheers
Uli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants