This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC 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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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.
It is sorta covered in the JavaRanch Style Guide.
subject: JDBC Transction over EJB Transaction
Similar Threads
JDBC connection and transactions
ejb doubt
Issue with Hibernate transaction in CMT
jdbc update committed instantly when outside of transaction?
How to combine JDBC & EJB in one transaction?