Hi,
Which the better way of using transactions. Should I use jdbc transactions or should I use bean managed ejb transactions? What are pros and cons of each?
RA
-
Which transaction to use Database transactions or ejb ? (4 messages)
- Posted by: Ritu Chempa
- Posted on: September 26 2002 05:48 EDT
Threaded Messages (4)
- Which transaction to use Database transactions or ejb ? by vindhyachal sharma on September 26 2002 06:48 EDT
- Which transaction to use Database transactions or ejb ? by Ritu Chempa on September 26 2002 07:02 EDT
- Which transaction to use Database transactions or ejb ? by Lasse Koskela on September 26 2002 07:14 EDT
- Which transaction to use Database transactions or ejb ? by Ritu Chempa on September 26 2002 07:02 EDT
- Which transaction to use Database transactions or ejb ? by Alex Pisarev on September 26 2002 11:20 EDT
-
Which transaction to use Database transactions or ejb ?[ Go to top ]
- Posted by: vindhyachal sharma
- Posted on: September 26 2002 06:48 EDT
- in response to Ritu Chempa
Hi,
U r question is not clear but if ur using BMP Entity Beans use Bean managed transation, JTS is already implemented by the Application Server Vendor so u will get good Transaction Control through Bean Container.
Rgds
Sharma
(vindhyachalsharma at yahoo dot com) -
Which transaction to use Database transactions or ejb ?[ Go to top ]
- Posted by: Ritu Chempa
- Posted on: September 26 2002 07:02 EDT
- in response to vindhyachal sharma
Im my earlier project this is the architecture I have used. Data Access Objects (no entity beans, normal java classes) were used to do database operations. These DAOs were called from a stateless session bean. So the db connection lookup was made from the ejb, and instead of using jtx.begintransaction, we were using connection.begintransaction. That is jdbc transactions, instead of ejb transactions. What is the difference between these two? Which approach is better? -
Which transaction to use Database transactions or ejb ?[ Go to top ]
- Posted by: Lasse Koskela
- Posted on: September 26 2002 07:14 EDT
- in response to Ritu Chempa
I've understood that the preferred way would be to use the UserTransaction object (from JNDI tree, provided by appserver) to begin, commit, and rollback transactions. That is, of course, if we're not using container managed transactions.
So, what have I misunderstood if anything? -
Which transaction to use Database transactions or ejb ?[ Go to top ]
- Posted by: Alex Pisarev
- Posted on: September 26 2002 11:20 EDT
- in response to Ritu Chempa
Well,
You should differ code transactions and data transactions here. Using JTA and bean managed transaction demarcations you have a chance of rolling back/commiting not only the data, but code as well. JTA transactions will automatically start JDBC transactions for you either.
Alex