• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Container provides Transactional Services which is exposed through through JTA API .

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

This line is taken from the book called as Mastering EJB 3.0

The EJB Container provides Transactional Services .The Transactional Services is exposed through through JTA API .

Please tell me what dos it mean by this actually ??
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ravi,

basically it means what it says :-) Every JEE compliant container provides services for transaction handling based on the JTA API. Then in your code it's usually enough to provide a minimum of declarative metadata (=annotations or XML) to use these transaction services of the container for your business interface methods etc.

Marco
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Macro Once again .

Say for example if i used



Please tell me is this above code anywhere will be related to JTA??

Thank you
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome ;-)

Your example is related to the JTA because JTA is the way a JEE container implements its transaction services. The JEE transaction annotations are just a declarative way to configure the exact transaction requirements if the defaults don't fit your needs!

Another way would be to use bean managed transaction where you would have to access the JTA directly in your source code but usually it's a lot better to let the container do this for you and only use the annotations.

I hope that makes it a little bit clearer. JTA is the way how transaction services are realized under the hood in a compliant JEE application server.

Btw.: If you don't specify some annotations there's simply a default behavior which is then of course more or less hidden. Every method which is part of th business interface of a session bean uses @TransactionAttribute(REQUIRED) as its default for example as long as you don't explicitly override this behavior.

Marco
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you it was nice explanation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!