In theory, we say that we can't use JTA and JPA (javax.persistence) on a J2SE annotation. It is reserved only for J2EE. Is that really true? What if we are using Hibernate on a AWT desktop application? There are two libraries named "Hibernate JPA", and "Hibernate JTA". We can use those J2EE classes on our J2SE desktop application?
Oh, there is an javax.persistence.EntityManager class too. Does it mean that we can use JPA on Hibernate, or it just something like JPA-simulated hibernate?
I'm new to Hibernate, therefore please kindly answer.
Take a look at some of the introductory Hibernate tutorials that you can get to from my signature links.
You'll notice that all of the initial examples use JPA annotations, and all of them run from a J2SE application with a main method, and all of those stand-alone J2SE applications start and end their own transactions. None of the examples run within a J2EE container at all.
So, if you want to use the J2EE containers implementation of the Java Transaction API, then you need a J2EE container. But Hibernate provides facilities for coordinating XA compliant transactions without the use of a J2EE container whatsoever.