• Post Reply Bookmark Topic Watch Topic
  • New Topic

using JPA in Jboss  RSS feed

satish bodas
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been trying to setup JPA usage in JBoss .

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 test so I used a JSP ( 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 ::

This started giving me an exception of the kind ::

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 JDBC 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 ?

Thanks ,
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!