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

Container managed transactions: Lookup of java:comp/UserTransaction not allowed for Container managed Transaction beans #651

Open
tsbatista opened this issue Oct 21, 2014 · 10 comments
Labels

Comments

@tsbatista
Copy link

This illustrates what I think is wrong:

https://github.com/tsbatista/kundera-cmt

Basically, if I try to use kundera and CMT under glassfish, it breaks as you try to lookup a user transaction here: https://github.com/impetus-opensource/Kundera/blob/273c13342ddd1aceed0cd23504649926ce8fdb84/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/EntityManagerImpl.java#L858

Is there any way to use CMT on glassfish?

@mevivs
Copy link
Collaborator

mevivs commented Oct 21, 2014

@tsbatista check this out
https://github.com/impetus-opensource/Kundera/wiki/Transaction-Management.

Most of JTA implementation like atomikos, hibernate one etc are bound with JDBC API which is not applicable in case of NoSQL databases and Kundera. So Kundera brings in its own implementation of JTA transaction and which would require to define binding

ctx.lookup("java:comp/UserTransaction");

With tomcat you can easily bind this, but for EJB containers i can't find a way for the same. Would definitely like to know your views/suggestions on this!

-Vivek

@tsbatista
Copy link
Author

I dont have much time right now. I will look at this during the weekend and get back to you if I have any ideas.

@mevivs
Copy link
Collaborator

mevivs commented Oct 22, 2014

@tsbatista let's keep it open for discussion. Would appreciate your views whenever you get some time to discuss.

-Vivek

@hwaastad
Copy link

Hi, I've started to test Kundera along with TomEE and have met a couple of issues, and maybe related to this discussion.

Please bind [com.impetus.kundera.persistence.jta.KunderaJTAUserTransaction] for :{java:comp/UserTransaction} lookupclass org.apache.openejb.core.CoreUserTransaction

I asked TomEE dev's if it's possible to fix this by using resources og setting system properties, but Romain (at TomEE) suggested this:

The easiest is to ask kundera to support a
kunderaUserTransactionProvider in the persistence unit properties. It
is trivial for them to do and you don't break other JTA usages then.

Side note: this is more or less what does all JPA provider: having a
little SPI configurable in persistence unit properties to get the
transactional environment.

Would this be doable?

br hw

@mevivs
Copy link
Collaborator

mevivs commented Nov 20, 2014

@hwaastad
Let me think about and post an update on this.

-Vivek

@hwaastad
Copy link

Hi, sure,
and I'll happily help testing when needed :-)

@mevivs
Copy link
Collaborator

mevivs commented Dec 22, 2014

@hwaastad
Sorry for late response, kinda got busy with some stuff.
Can you please share a sample project to try it my end with TomEE?

-Vivek

@hwaastad
Copy link

hwaastad commented Jan 2, 2015

Hi,
I'll see if I can push a project to github during the weekend.

Edit:
https://github.com/hwaastad/KunderaDebugTest.git

Pretty simple implementation just for providing the error described

br hw

@hwaastad
Copy link

@mevivs
Did you have a look at this issue?

br hw

@cristof
Copy link

cristof commented Oct 29, 2015

@mevivs

I've stumbled with this same problem when trying to use kundera in a JavaEE project. It makes kundera a no-go for container managed transactions. Any news about the solution proposed by @hwaastad based on the suggestion of Romain from Tomee?

Regards,
Paulo

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

No branches or pull requests

5 participants