Nicholas Perez wrote:
You should probably look at using one of the many DBI POE Components.
Most of them fork off a separate process with Wheel::Run and allow for
concurrent processing.
I will eventually as I get more into POE servers. I have around a dozen
applications where these would work great with some of those using
database access.
Otherwise, yes, I would create instance variables within each session
that needs them instead of globals. Depending on how deep your event
chain is before a meaningful value is returned to the client, you
could easily be trampling globals if say, you instantiate a statement
handle on connect, while somewhere in the middle of processing events
for another request.
Though it is a pretty simple script/application, if the network access
to the database is busy a statement handle could still be active when
the next one starts.
Thanks for the insight,
Rod
--
HTH,
nperez
On 7/19/07, Roderick A. Anderson <[EMAIL PROTECTED]> wrote:
We have a script based on "Web_Server_With_Components" from the cookbook
and each of the "Important" ContentHandlers accesses a PostgreSQL
database.
The quick question is:
Should the DBI handles and/or the statement handles be created in the
ContentHandlers?
Currently we're doing them outside (global) which makes us suspect they
are tampling on each other and bringing the POE server down or at least
un-responsive.
TIA,
Rod
--