Basic HTML version of Foils prepared May 3 1998

Foil 55 Transaction Processing

From Java Blend and Cold Fusion High Level Database Interfaces CPS616 Web Technologies -- Spring 98. by Chao Wei Ou


CFTRANSACTION tag is treated as a transactional unit. This means that changes made to the database are not committed until all queries in the transaction block execute successfully. If an error occurs in one of the queries, all changes made by previous queries within the transaction block are rolled back.
<CFTRANSACTION>
<CFQUERY NAME="WithdrawCash" DATASOURCE="BankDB">
UPDATE Accounts
SET Balance=Balance - #Amount#
WHERE Account_ID=#AccountFrom#
</CFQUERY>
<CFQUERY NAME="DepositCash" DATASOURCE="BankDB">
UPDATE Accounts
SET Balance=Balance + #Amount#
WHERE Account_ID=#AccountTo#
</CFQUERY>
</CFTRANSACTION>



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998