1) nope, the one bundled with your application server is all you need, and basic code should not need to care about the JPA provider.
2) EJB3 only is probably better, because your app is able to run on different app servers, and if the EJB standard is changed, your app will probably still work. But the more complex your app becomes, the more chance is that you need to work with the JPA layer directly...
Hope this helps a bit
I got your point...but...
talking about hibernate :It supports standardized Java Persistence and EJB 3.0 (JSR 220) object/relational mapping annotations + on top of that It has Hibernate-specific extension annotations for performance optimization and special mappings...right...?
So wouldnt it be better to go with EJB + Hibernate...?
this depends on your app. If it has support different servers, you should not use Hibernate.
If you know that this app will never run on other servers than JBoss, you can use EJB3 and Hibernate (hoping that JBoss will never change the persistence provider).
Probably bad things will happen, if you mix Hibernate and a JPA provider of another vendor ;-).
Hope this helps
Obviosly...bad things can happen, if anyone mix Hibernate and a JPA provider of another vendor.... :)
Today...I successfully...implemented and ran my first EJB3 Application with Struts 2 framework... & JBOSS 4.2.3GA as AS :)
Although I developed it with very basic features of EJB3,struts2...it has raised few more questions in my mind...
1) Dependency Injection didn't work in struts Action...why...?
2) U said....The Application will require the JPA Provider bundled with application server...
I didn't configure any Persistence provider in my Persistence.xml file...still the application worked...how..?