Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Sharing database handle

by Zapawork (Beadle)
on Apr 18, 2002 at 19:58 UTC ( #160327=note: print w/ replies, xml ) Need Help??


in reply to Sharing database handle

Here is another idea,
You are already spawning child processes so why not set up either a bidirectional pipe or a seperate IPC to allow the child to send requests to the parent. In this fashion the parent could have one main routine to poll the child processes for queries, test the connect (dbi->ping, dbi is just a great package) and then execute and return the information to the child.

In this model you would seem to accomplish your goal, you wuold allow all of your child processes to communicate through one ODBC connection, you'd have only one ODBC connection and for fun you'd have one place to check for improper data within queries.
Dave -- Saving the world one node at a time


Comment on Re: Sharing database handle
Re: Re: Sharing database handle
by graff (Chancellor) on Apr 20, 2002 at 01:02 UTC
    This is a nifty thought, but I'd worry that it would make the parent/server a bit monstrous and hard to get right. I guess if each child request is read, executed and answered back to the child in one block, it's certainly manageable.

    There still is the empirical question: is it better to serialize all activity through a single, very active connection, as opposed to having a bunch of connections (leaving it to the DBMS to coordinate the actions, which is, in part, what it was written to do)? I don't really know that yet (sorry).

      Sorry about the late response,
      Proof to the pudding, so to speak, for this type of practive goes back to the ODBC models that all of your modern day websties use.
      Having one central connection allows you to control access while guaranting preformance. If you need data in a large scale form, you usually implement application servers to cache and give performance enhancements.
      Hope this helps
      Dave -- Saving the world one node at a time

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://160327]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-12-19 21:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (92 votes), past polls