File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Transction over EJB Transaction" Watch "JDBC Transction over EJB Transaction" New topic
Author

JDBC Transction over EJB Transaction

nidhish
Greenhorn

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

Thanks
Nidha
David O'Meara
Rancher

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
Rancher

Joined: Mar 06, 2001
Posts: 13459

"nidha",
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.
 
jQuery in Action, 2nd edition
 
subject: JDBC Transction over EJB Transaction