• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate JPA and JTA on J2SE platform

 
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Does that make any sense?

Hibernate and Transcations from a Stand-Alone J2SE Application (not J2EE/JEE5)



Regards,

-Cameron McKenzie
 
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic