threads and caching of DBI-handels

From: Alexander (alexander.sommer_at_vodafone.com)
Date: 07/29/04


Date: Thu, 29 Jul 2004 17:51:57 +0200
To: "Perl iThreads \(E-Mail\)" <perl-ithreads@perl.org>, "Perl DBI-Users \(E-Mail\)" <dbi-users@perl.org>

Hello,

I have a question, about ithreads and the DBI-module.
I use threads in a perl-script which is a Monitor for an other Aplication, so my script runs as daemon and starts threads which connect to the DB collect some data and come back.
My Problem is, that my script starts the thread every 2 Minutes by the cron-module. So I open at the moment every 2 Minutes a DBI-connection. This is not very nice for the DB.

So I search a method where I can store my DB-handel.
I tested with connect_cached but then every new thread makes a new connection to the DB.
And it is not possible to make a connect in the father-thread because DBI sayd the DB-handel is not yours, it is from an other thread :-((

But I think this should be possible because the Apache::DBI do this, when I understand the Apache::DBI correctly.

Gruß Alex



Relevant Pages

  • Re: Slightly [OT] Network Monitoring/Alerting tools
    ... Of course if your server is prone to running out of resources you should also be collecting that data via snmp with thresholds to notify you before you have an outage or at least graphing it so you'll understand the trends. ... We were able to use the monitor to look for ... Most of the common things you would want are already built in so you don't have to script them - or install scripts on all the clients. ...
    (Fedora)
  • Re: trouble with Javascript Pop-up
    ... I was talking about some script to center your page on the monitor, ... the text link itself, the pop-up window generated ... You might play with the size of the fragment box...and you aren't using a ...
    (microsoft.public.publisher.webdesign)
  • Re: trouble with Javascript Pop-up
    ... have been that I had my monitor set to 120 dpi, ... Here's the script for the pop-up: ... There is a centering code, but in the script, ... You might play with the size of the fragment box...and you aren't using a ...
    (microsoft.public.publisher.webdesign)
  • Windows Script to monitor file size on remote servers
    ... I have recently written a script to monitor the file size on ... tricky part was to determine %systemroot% on remote systems (not ... or FQDNs of the servers you wish to connect to. ...
    (microsoft.public.scripting.vbscript)
  • Re: Command or setting to force monitor on?
    ... Keystrokes vbs script? ... But the same symptoms as without cscript, monitor not waking up, when I ... I set up a batch file containing the commands to first start IE, ... could move to the keystrokes command. ...
    (microsoft.public.windowsxp.general)