It's a wrapper. I'm updating and putting in a POD now. I'm also going to add an example of when this fails -- it seems mySQL clients < 4.00 are thread safe.

Update: Thanks gmax for pointing out why DBD::mysql clients can't fork for mysql version 4+, this node. For what it's worth, code to replicate this problem can be used here:

#! /usr/bin/perl use strict; use warnings; use DBI; my $conn = DBI->connect("DBI:mysql:database=db;host=localhost;", "user +", "password"); my $pid = fork; die ("No more resources") unless (defined $pid); my $query = "SELECT * FROM table"; my $result = $conn->prepare($query) or die ("Cannot prepare query. $!"); $result->execute or die ("Cannot execute query. $!");

Want to support the EFF and FSF buy buying cool stuff? Click here.

In reply to Re: Re: Thread and Fork Safe DBI and DBD::mysql replacement by Vautrin
in thread Thread and Fork Safe DBI and DBD::mysql replacement by Vautrin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.