Register / Login
Win a copy of
The Little Book of Impediments (e-book only)
this week in the
Agile and Other Processes
Object Relational Mapping
using JPA in Jboss
posted 8 years ago
I have been trying to setup JPA usage in
Here is what I did ::
1 >setup a datasource for Postgres in Jboss
2 >set up the persistence.xml file
In this file I specified the datasource as ::
I then wanted to do a quick and dirty
so I used a
( I know its not good practice - this was just a test )
I imported the EnitytManager and other imports in the JSP ( javax.persistence.* )
Code ran fine
Question 1 > I was surprised since I didnt and still dont know which jars needed to be added to app classpath for JPA
Myseteriously it worked
Am guessing that these are bundled with Jboss 4.2.2 ?
Now I tried adding code in jsp ::
EntityManagerFactory emf = Persistence.createEntityManagerFactory("ABC");
This started giving me an exception of the kind ::
The chosen transaction strategy requires access to the JTA TransactionManager]
Found some info on the following link ::
Here they are advising the usage of non-jta datasource
Question - how does a JTA datasource differ from non jta datasource ?
( Is this related to who will take care of transactions ? - either JTa ( managed env ) or
etc ( Non Managed )
since I am accessing the Persistence framework from a JSP does this mean that I have to use the non-jta data source ?
Is this something specific to Jboss or something common across different application servers ?
How to Configuring mysql db with JPA aplication?
Unable to build EntityManagerFactory
JNDI for Oracle Database,DataSource in JBoss
validate or look if "Bean-Managed-Transaction" or "Container-Managed-Transaction"
Problem using JBOSS