<!-- Presentation generated by Internet Assistant for Microsoft PowerPoint 97 -->
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft Internet Assistant for Microsoft PowerPoint 97">
<TITLE>Transactions - Example code</TITLE>
</HEAD>
<BODY >
<CENTER>
<TABLE WIDTH=100%>
<TR> <TD WIDTH=100% ALIGN=CENTER>
<A HREF="sld001.htm">First</A>
<A HREF="sld053.htm">Previous</A>
<A HREF="sld055.htm">Next</A>
<A HREF="sld102.htm">Last</A>
<A HREF="index.htm">Index</A>
<A HREF="dbi.perl.org">Home</A>
<A HREF="tsld054.htm">Text</A>
</TD> </TR>
<TR> <TD WIDTH=100% ALIGN=CENTER>
<IMG SRC="img054.gif" usemap="#Objmap" WIDTH=800 HEIGHT=600 BORDER=0>
</TD> </TR>
</TABLE>
<P>Slide 54 of 102</P>
</CENTER>
<!-- <UL>
<H2>Transactions - Example code</H2>
</UL></P>
<P><UL>
$dbh->{RaiseError} = 1;
<BR>$dbh->begin_work; # AutoCommit off till commit/rollback
<BR>eval {
<BR> $dbh->method(
); # assorted DBI calls
<BR> foo(...); # application code
<BR> $dbh->commit; # commit the changes
<BR>};
<BR>if ($@) {
<BR> warn "Transaction aborted because $@";
<BR> $dbh->rollback;
<BR> ...
<BR>}
</UL>
<BR>
<BR>.</P>
<P> -->
</Body>
</HTML>