What are the considerations for deciding on transaction boundaries?
Location: http://www.jguru.com/faq/view.jsp?EID=507220 Created: Sep 30, 2001 Author: Joe Sam Shirah (http://www.jguru.com/guru/viewbio.jsp?EID=42100) Question originally posed by Vinod Kaggal (http://www.jguru.com/guru/viewbio.jsp?EID=112370 Transaction processing should always deal with more than one statement and a transaction is often described as a Logical Unit of Work ( LUW ). The rationale for transactions is that you want to know definitively that all or none of the LUW completed successfully. Note that this automatically gives you restart capability. Typically, there are two conditions under which you would want to use transactions: • Multiple statements involving a single file – An example would be inserting all of a group of rows or all price updates for a given date. You want all of these to take effect at the same time; inserting or changing some subset is not acceptable. • Multiple statements involving multiple files – The classic example is transferring money from one acc