• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTA EntityManager cannot access a transactions

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How do you configure a Hibernate EntityManager for a JTA data source? I'm using JBoss 4.2.3.GA, Hibernate 4.1.5.SP1, Hibernate validator 4.3.0.Final, and MySQL 5.5. Here's my $JBOSS_HOME/server/default/deploy/mysql-ds.xml JTA data source configuration …



I'm trying to deploy a JAR file. Here's my META-INF/persistence.xml …



Here's how I try and run a basic transaction, but I'm getting a "JTA EntityManager cannot access a transactions" exception. Full stack trace is below. What am I missing here?



The ugly exception …



Thanks, - Dave
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All it's trying to say (in unclear terms) is that you can't call getTransaction() method on a JTA entitymanager http://docs.oracle.com/javaee/6/api/javax/persistence/EntityManager.html#getTransaction%28%29
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic