aspose file tools
The moose likes JDBC and the fly likes Transaction Management Query Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Transaction Management Query" Watch "Transaction Management Query" New topic
Author

Transaction Management Query

Gaurav Jain
Ranch Hand

Joined: Mar 11, 2004
Posts: 108
In our architecture the stateless session bean calls the service (POJO) which in turn calls the DAO which does the DB operation.Taking the classic debit/credit example how should the transaction management be controlled if either of the debit or credit operation fails? We are using stored procedure instead of direct SQL's.To clarify further we want to rollbackt the entire process of debit if credit fails and vice versa.
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1076

It depends on the actual need of requirement.Use the container managed transaction. Since you are using stored procedure, make sure that their is no rolback or commit inside stored procedure.
It also depeneds on the code of stored procedure that in what way stored procedure is handling exception and failure.
If your stored procedure returns some custom error code then you need to handle that and in such cases User transaction would do the task better.
you are the one who can better decide what suits to your environment


Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Transaction Management Query
 
Similar Threads
This week book give away
Online shopping with Debit card
Payment
Is an Insurance a Liability or an asset?
Student discounted SCJP Voucher ... after Sun purchase