----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

I think the spec says (please correct me if i'm wrong) that servlets are 
loaded but are only recycled when memory gets thin and they havent been used
for a while.  You could try hooking your servlet up with a timer class ( in
the init method ) and after a while the timer calls the servlets destroy
method, which cleans up the databse connection.  Outlined below

rick


myservlet

MyTimer t;

init(){

    t=new Timer(5000, this);

}

destroy(){
    //clean up
}

}


timer class{
    long sleep;
    object o;
    public timer(sleep time, object o){

    }

    run{

    sleep(sleep);

    o.destroy();

    }
}

----------
>From: Richard Begg <[EMAIL PROTECTED]>
>To: "'[EMAIL PROTECTED]'" 
<[EMAIL PROTECTED]>
>Subject: JServ - Servlet Existence Period
>Date: Wed, May 17, 2000, 9:16 AM
>

> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files.  Don't make us guess your problem!!!
> ----------------------------------------------------------------
>
> Hello All,
>  I have posted about this previously and got no response, I've ran
> the system for another week or so and I am still having the same problem.
>
>  When a servlet is initialised it is not being destroyed for quite a
> long period of time, now if this servlet was in constant use during this
> period I could understand this long time period.  But the server is only
> really used on a Monday as it is used for entering timesheet information
> into a database (using JDBC).  Here's my jserv log file to show just how
> long the servlets are been loaded for:
>
> [16/05/2000 08:03:57:468 GMT] GenerateTimeSheet: init
> [16/05/2000 08:16:14:109 GMT] GenerateLogon: init
> [16/05/2000 08:17:01:000 GMT] LoggedOn: init
> [16/05/2000 08:17:05:203 GMT] GenerateBlankTimesheet: init
> [16/05/2000 09:45:44:921 GMT] ReviewTimesheet: init
> [16/05/2000 09:45:49:609 GMT] ReviewTeamTimesheets: init
> [17/05/2000 08:24:52:578 GMT] GenerateWorkPackList: init
> [17/05/2000 11:58:48:546 GMT] GenerateTimeSheet: destroy
> [17/05/2000 11:58:48:703 GMT] GenerateWorkPackList: destroy
> [17/05/2000 11:58:48:718 GMT] ReviewTeamTimesheets: destroy
> [17/05/2000 11:58:48:750 GMT] ReviewTimesheet: destroy
> [17/05/2000 11:58:48:750 GMT] LoggedOn: destroy
> [17/05/2000 11:58:48:765 GMT] GenerateLogon: destroy
> [17/05/2000 11:58:48:781 GMT] GenerateBlankTimesheet: destroy
>
>  Now this usually wouldn't create a problem but the JDBC-ODBC bridge
> driver in conjunction with Access has a problem which means a connection to
> a database is only valid for a finite number of accesses.  I could change
> the code so that for every access a new connection is created but this would
> greatly decrease the speed of the servlet.
>
>  I would like JServ to unload the server after a short period of time
> (say 5 minutes).  Is this possible and if so how would I do this?
>
> Cheers,
> Rich.
>
> Richard A. Begg
>
> Serco Technology,
> Guisborough,
> England.
>
>
> e-mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
>
>
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to