<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street"
 downloadurl="http://www.5iantlavalampft-com:office:smarttags"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City" downloadurl="http://www.5iamas-microsoft-com:office:smarttags"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="address" downloadurl="http://www.5iamas-microsoft-com:office:smarttags"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="country-region" downloadurl="http://www.5iantlavalamp.com/"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place" downloadurl="http://www.5iantlavalamp.com/"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:2115468845;
        mso-list-template-ids:-1635229640;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>You could create a logging class. In each
important procedure on the server&#8217;s RDM, create a logging instance at the
beginning of the procedure. Wrap the procedure in a try finally, freeing the
logging object at the end of the procedure. Within the try..finally, have a try&#8230;except,
catching any exception and feeding it to the logging object. The logging object
records to file, the start and end times of the procedure, any exceptions, etc.
In this way you&#8217;ll find procedures that are bottlenecks, procedures that
throw exceptions, and any that never return, for whatever reason.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>To reduce the volume of your log file, on
freeing of the logging object, you could do some tests &#8211; if no exceptions
were recorded in the procedure and it didn&#8217;t take too long to execute,
then don&#8217;t write any info to file &#8211; only write to file for
exceptions or very long times. However, then you&#8217;d miss any procedure
which never returns. For this you&#8217;d need to log a procedure name and time
stamp on create of the logging object.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>You could have an app server switch to
turn logging on and off, so that it&#8217;s not going all the time, but only
when indicated from the app server GUI.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>This may help you find something&#8230;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Dave<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
delphi-bounces@ns3.123.co.nz [mailto:delphi-bounces@ns3.123.co.nz] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Stacey Verner<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, 2 September 2005
9:48 a.m.<br>
<b><span style='font-weight:bold'>To:</span></b> NZ Borland Developers Group - <st1:place
w:st="on">Delphi</st1:place> List<br>
<b><span style='font-weight:bold'>Subject:</span></b> [DUG] DataSnap/Midas App
Server Error</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>We have an DataSnap/Midas app server which fails randomly.</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>We can't make it happen no matter how hard we try, but it
happens fairly regularly on our production machine.</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>A little bit of info on the app and app server:</span></font><o:p></o:p></p>

</div>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l0 level1 lfo1'><font size=2 face=Arial><span style='font-size:
     10.0pt;font-family:Arial'>The applicaiton is a normal database
     application.</span></font><o:p></o:p></li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l0 level1 lfo1'><font size=2 face=Arial><span style='font-size:
     10.0pt;font-family:Arial'>The application also needs to get information
     from&nbsp;a settings&nbsp;(metadata) database such as:</span></font><o:p></o:p></li>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l0 level2 lfo1'><font size=2 face=Arial><span
      style='font-size:10.0pt;font-family:Arial'>Which databases&nbsp;they have
      access to</span></font><o:p></o:p></li>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l0 level2 lfo1'><font size=2 face=Arial><span
      style='font-size:10.0pt;font-family:Arial'>What permissions they have on
      the database etc</span></font><o:p></o:p></li>
 </ul>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l0 level1 lfo1'><font size=2 face=Arial><span style='font-size:
     10.0pt;font-family:Arial'>Instead of connecting directly to the settings
     database we use the app server which shares one database connection
     between all clients.</span></font><o:p></o:p></li>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l0 level2 lfo1'><font size=2 face=Arial><span
      style='font-size:10.0pt;font-family:Arial'>This means that there is one
      database connection for each application instead of 2 which reduces
      licencing costs</span></font><o:p></o:p></li>
 </ul>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l0 level1 lfo1'><font size=2 face=Arial><span style='font-size:
     10.0pt;font-family:Arial'>We use the borland socket server and a socket
     connection to connect to the app server.</span></font><o:p></o:p></li>
 <ul type=circle>
  <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:
      auto;mso-list:l0 level2 lfo1'><font size=2 face=Arial><span
      style='font-size:10.0pt;font-family:Arial'>When we used a normal DCOM
      connection each client got its own copy of the app server, so the
      settings database connection is not shared and in effect
      each&nbsp;application&nbsp;had two connections to the database.</span></font><o:p></o:p></li>
 </ul>
</ul>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Sometimes the app server locks up and the clients can't
connect.</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>We have a work around that will try app servers on other
machines if this fails which works OK, but if it never gets a connection the
all sorts of odd things happen.</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Firstly, does anyone have any thoughts on this. Debug ideas
etc?</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Secondly, when&nbsp;the connection to the app server fails
it takes forever (minutes) to return no matter what I set the socket connection
timeout to.</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Stacey</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>Stacey
Verner&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Ph:&nbsp;&nbsp; +64-9-4154790<br>
Software Developer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fax:&nbsp;
+64-9-4154791<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DDI:&nbsp; +64-9-4154797<br>
CJN Technologies Ltd.&nbsp;&nbsp;&nbsp;&nbsp; Email: </span></font><a
href="mailto:stacey@cjntech.co.nz"><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>stacey@cjntech.co.nz</span></font></a><br>
<st1:Street w:st="on"><st1:address w:st="on"><font size=2 face="Courier New"><span
  style='font-size:10.0pt;font-family:"Courier New"'>PO Box 302-278, North</span></font></st1:address></st1:Street><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
Harbour, <st1:City w:st="on">Auckland</st1:City> 1330, <st1:country-region
w:st="on"><st1:place w:st="on">New Zealand</st1:place></st1:country-region><br>
<st1:Street w:st="on"><st1:address w:st="on">12 Piermark Drive, North</st1:address></st1:Street>
Harbour, <st1:place w:st="on"><st1:City w:st="on">Auckland</st1:City>, <st1:country-region
 w:st="on">New Zealand</st1:country-region></st1:place><br>
Visit our website at </span></font><a href="http://www.cjntech.co.nz/"><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>http://www.cjntech.co.nz/</span></font></a><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
</span></font><o:p></o:p></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

</div>

</body>

</html>