The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

<!--  Presentation generated by Internet Assistant for Microsoft PowerPoint 97 -->

<HTML>
<HEAD>

<meta name="GENERATOR" content="Microsoft Internet Assistant for Microsoft PowerPoint 97">
 <TITLE>Web DBI - State-less-ness</TITLE> 
</HEAD>

<BODY     >

<CENTER>
<TABLE WIDTH=100%> 
     <TR> <TD WIDTH=100% ALIGN=CENTER>
         <A HREF="sld001.htm">First</A>&nbsp;&nbsp;
         <A HREF="sld068.htm">Previous</A>&nbsp;&nbsp;
         <A HREF="sld070.htm">Next</A>&nbsp;&nbsp;
         <A HREF="sld096.htm">Last</A>&nbsp;&nbsp;
&nbsp;&nbsp;         <A HREF="index.htm">Index</A>&nbsp;&nbsp;
         <A HREF="dbi.perl.org">Home</A>&nbsp;&nbsp;
         <A HREF="tsld069.htm">Text</A>&nbsp;&nbsp;
     </TD> </TR>
     <TR> <TD WIDTH=100% ALIGN=CENTER>
         <IMG SRC="img069.gif" usemap="#Objmap" WIDTH=800 HEIGHT=600 BORDER=0>
     </TD> </TR>
</TABLE>
<P>Slide 69 of 96</P>
</CENTER>
<!-- <UL>
<H2>Web DBI - State-less-ness</H2>
</UL></P>
<P><UL>
<LI><H2>No fixed client-server pair
</H2>
<UL>
<LI>Each request can be handled by a different process.
<LI>So can't simply stop fetching rows from $sth when one page is complete and continue fetching from the same $sth when the next page is requested.
<LI>And transactions can't span requests.
<LI>Even if they could you'd have problems with database locks being held etc.
</UL></UL><UL>
<LI><H2>Need access to 'accumulated state' somehow: 
</H2>
<UL>
<LI>via the client (e.g., hidden form fields - simple but insecure)
<UL>
<LI>Can be made safer using encryption or extra field with checksum (e.g. MD5 hash)
</UL><LI>via the server:
<UL>
<LI>requires a session id (via cookie or url)
<LI>in the database (records in a session_state table keyed the session id)
<LI>in the web server file system (DBM files etc) if shared across servers
<LI>Need to purge old state info if stored on server, so timestamp it
<LI>See Apache::Session module
</UL><LI>DBI::ProxyServer + connect_cached with session id may suit, one day
</UL></UL><UL>
<H2>.</H2>
</UL></P>
<P>  -->
</Body>
</HTML>