Hi Matthew,

The question is connected with the task to create so named Connection Pool
Server (see the letter attached),
so I _need_ to create connection handle in one process and pass it to
another and vice versa.
For the moment I do not see any other way to resolve the task described in
the letter.
Probably you can advice me how can I solve this ?.

Ildar.

----- Original Message -----
From: "Matthew O. Persico" <[EMAIL PROTECTED]>
To: "Ildar Gabdulline" <[EMAIL PROTECTED]>
Sent: Sunday, September 01, 2002 8:22 PM
Subject: Re: Passing DBI connection between processes


On Sun, 1 Sep 2002 19:24:05 +0400, Ildar Gabdulline spaketh:
>Hi,
>
>Is it possible to create DBI handle it one perl process, pass it to
>the
>second perl process, use it and return to the first ?
>If it is then how can it be accomplished ?
>
>Ildar.
>

Is it possible? Yes. Should you do it? Absolutely not.

The only way I know of to pass anything off to a second process is create
you "thing" in the first process, then fork off a child process, which is
the second process.

However, there are all sorts of complications in doing this. Search the
archives for details. You best bet is to pass the login info to the second
process and open the handle there.

--
Matthew O. Persico






--- Begin Message ---
Hi,

I have the question regarding the usage of the DBI.
 
The situation is as follows:
We are working on the telecom system that handles phone calls.
Every call is served by a separate perl script process.
The process is started when a call arrives at the system and dies when the call finishes.
There can be hundreds and thousands (1-2 thousands) calls (script processes)
in the system working simultaneously.
 
Perl script should have easy and fast access to the database (we use ORACLE).
For the moment the architecture of the system is as follows:
perl script process -> Data Access Server -> ORACLE.
(request is passed to the Data Access Server as simple string and parsed by it).
Data Server has persistent connection to the Oracle and is shared by the scripts.
 
I am going to make some optimizations and change the system such way that script 
directly works with the database by mean of the DBI interface, i.e.:
 
perl script process -> ORACLE.
 
However there is the problem here: creating and removal of database connections - it is _expensive_ task.
 
Suppose that algo should be as follows:
1. There is a server (or some script) that creates pool of connections at the startup.
    this server (so named 'Connection pool server') is always operational.
2. when call handling script starts it requests already created connection from the
    Connection Pool Server and uses the connection.
3. when call handling script finishes connection returns to the pool.
 
So,
the questions are as follows:
 
1. Is it possible to create connection in DBI, store in the file or in the memory and pass it to
    another perl script that can use it ?
 
2. If it is then how can it be accompished ? Can you point me some starting points regarding this task ?
 
-------------------------
Best regards,
Ildar Gabdulline
Project Manager, STELT Telecom
mailto  : [EMAIL PROTECTED]
WWW  : www.realeast.ru
 
--- End Message ---

Reply via email to