This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Could not enlist in transaction on entering meta-aware object!  RSS feed

 
Henrique Ordine
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I have a transaction which spans 2 session beans and each of these session beans interact with a different EntityManager. Also, these EntityManagers interact with different data sources.

The problem is, when I try to call o method on the second EntityManager, I get this "Could not enlist in transaction on entering meta-aware object!" exception.

I've read somewhere that if I invoke another sessionbean from a session bean (which is my case), I should use the same PersistenceContext in both EJBs. But I can't do this, since my PersistenceContexts point to different data sources.

Is there a way around this?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you configured your datasources to be XA?
 
Henrique Ordine
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not really, but thanks Jaikiran Pai, I'll try that.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!