Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

DB connection sharing w/o DBI?

by jptxs (Curate)
on Nov 03, 2001 at 21:25 UTC ( #123057=perlquestion: print w/replies, xml ) Need Help??

jptxs has asked for the wisdom of the Perl Monks concerning the following question:

Don't bother saying it =] I know I should use DBI. But this is one of those situations where installing a module that's not all perl is BAD. I have been through ten rounds on it already and cannot win. *whew*

So, with that out the way, anyone have suggestions on how best to do this? I will be forking off about ten or so kids and I know they can share objects. I was thinking just creating an oject that holds a DB connection prior to the fork and then they could all see it, right? I can't test until Monday, but I wanted to see what all/any of you thought, first. There may be some very simple option I'm missing. thanks =]

We speak the way we breathe. --Fugazi

Replies are listed 'Best First'.
Re: DB connection sharing w/o DBI?
by dws (Chancellor) on Nov 03, 2001 at 22:39 UTC
    But this is one of those situations where installing a module that's not all perl is BAD.

    You mention fork(), which suggests that you might not be in Win32. If you were, you could use either Win32::ODBC or Win32::OLE (to do db access through ADO). Both are part of the standard install (for ActiveState, at least).

    Please say more about what environment you're working on, and what type of database you're trying to connect to.

      Sorry about that. Been a while since I posted and I forgot my manners =]

      This would need to work on most *NIX flavors and it would always be connecting to Oracle. Took a stroll through CPAN before posting and seems all the modules to access Oracle involve some binary of some pure perl that I saw.

      We speak the way we breathe. --Fugazi

        To my knowledge there is no pure-Perl implentation of Oracle's network protocols. DBD::Oracle makes use of a locally-installed Oracle client library (which I suspect probably carries licensing issues) to do the actual work.

        You may have some luck getting ODBC to work. I believe there are some freely available ODBC implementations out there, though I don't know if any of those are pure-Perl either.

        You say you've gone through the process of trying to install non-Perl components (I'm assuming modules that are implemented at least partially in C) and have failed. I'm not sure that it's going to be easier for you to find an all-Perl solution this or if you just need to bite the bullet and solve whatever fundamental problem that exists with your system that is making it difficult for you to install C-based Perl modules.

Re: DB connection sharing w/o DBI?
by runrig (Abbot) on Nov 04, 2001 at 01:56 UTC
    Sorry to hear it. Sounds like maybe someone wants this solution to fail and is sabotaging it so it can be implemented some other way. You could pipe sql to SQL*Plus and read the results back out, it's kind of kludgy and slow but I did the same thing with Informix (piping to Informix's dbaccess) awhile back when it was taking a long time to get someone to install the Informix SDK (a prerequisite for DBD::Informix). I tried to batch the commands as much as possible so I wouldn't have to essentially connect to the database too many times. In fact, to be efficient, it might be worthwhile to just code alot of it in PL/SQL if you can't whack any sense into someone with a heavy clue x 4.
      you're close =] It's actually a large political war I'm trying to side-step. Short version is I'm taking functionality we have in one place and putting it in another because it makes sense. The official channels for getting that done are too busy arguing over who's got the bigger, errr.. I mean, who's going to get the credit. I figure if I just do it then the arguing becomes moot. But I have to do it without any official help, which means no altering the servers in any way I cannot as my own, eh?

      We speak the way we breathe. --Fugazi

        no altering the servers in any way I cannot as my own ID..

        Well, you can always install into your own directories by running 'perl Makefile.PL PREFIX=/home/myhomedirectory/perl/lib', and then making sure that the directories and files are readable by everyone, and using 'use lib qw(/home/myhomedirectory);' in all the scripts you write (that's assuming you're doing the make/make test/make install thing instead of using the CPAN module or downloading an ActiveState PPM or ...?) :-)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://123057]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2022-05-17 12:24 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (65 votes). Check out past polls.