Meaningless Drivel is fun!*
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Transction over EJB Transaction