[AWS] GET Form and Database
Dmitriy Anisimkov
anisimkov@omsknet.ru
Mon, 02 Jun 2003 14:56:58 +0700
DUCOS Frédéric wrote:
> Into a callback function, I try to connect to a database (ODBC) in order to check user/pwd from an user form (in GET method) but the server does not response to the client (TimeOut).
> However, in an independant program, this code (concerning database) run in 1 second.
>
> Anybody knows a solution on this problem ?
I see you are connecting to the DB each call to callback.
I propose you to have a connection allready opened before use it in the callback.
It is better to have protected pool (container) of DB connections.
> package body Cgtp_Cb is
>
> use Aws;
>
> function Get (
> Request : in Status.Data )
> return Response.Data is
>
> if URI = "/auth-form" then
>
> declare
> Cgtp : aliased Databases.Database;
> Query : Databases.Select_Statement (5);
>
> Login : String (1 .. 15);
> Password : String (1 .. 30);
> Nom : String (1 .. 50);
> Prenom : String (1 .. 50);
> Niveau : Positive;
>
> begin
> Databases.Connect (Cgtp, "cgtp", "test", "test");
.....