File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes JDBC Transction over EJB Transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC Transction over EJB Transaction" Watch "JDBC Transction over EJB Transaction" New topic

JDBC Transction over EJB Transaction


Joined: Apr 02, 2008
Posts: 1
can any one explian the difference between ejb transaction and JDBC transaction.

Which should be used for small application ejb transaction or JDBC transaction

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

JDBC transactions are managed by the database via the Database Connection.
EJB transactions are managed by EJB container and tries to combine several external transactions (eg JDBC) in a single EJB transaction context. This is a bit complicated and gets into things like 'two phase commits' and 'distributed transactions', but it is a thing the EJB container does for you.

Personally: If you are using EJBs then use EJB transactions, otherwise stick to JDBC transactions.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
I agree. Here's the link:
subject: JDBC Transction over EJB Transaction
It's not a secret anymore!