| Newsgroups |
gmane.comp.lang.perl.poe |
| Message-ID |
<[email protected]> |
Hah, I see :)
While SimpleDBI/EasyDBI isn't fork-aware they certainly can work in all
3 situations. If you are using POE::Wheel::Run or a similar module, it
will tell POE::Kernel to kill all sessions and "start fresh" so
SimpleDBI can concurrently work in the parent and the children without
causing weird stdio issues. However, if you have a parent and N
children, using SimpleDBI/EasyDBI will result in
parent+Nchildren+Nsubchildren processes. This might be too many if you
are forking say, 100 processes, ha!
If your child processes are doing "nothing" else than servicing the
request, then it's safe for them to block using regular DBI calls.
Otherwise, you could explore using the POE DBI modules to see which is a
better fit for you and to verify that it doesn't blow up in all of your
cases :)
Please let us know what you decided on, and if we can help you fix
issues that cropped up while you're playing around with it!
~Apocalypse
Markus Jansen wrote:
> Hi,
>
> at present, I use POE in both the parent and the children, which can cause trouble
> with non-fork aware modules with external connections;
> in another context, I use POE in a single process;
> finally, the third context is mod_perl2 not using POE -
> database access patterns should be the same for all three,
> as I tend to be generically lazy :-).
>
> Best regards,
> Markus
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Thursday, February 17, 2011 9:46 PM
> To: Markus Jansen
> Cc: [email protected]
> Subject: Re: POE and DBI database question
>
> Hello,
>
> I am the author of SimpleDBI and EasyDBI was forked from it to add it's own features. I would recommend either one of them, but I need to further understand what server framework you are using. If you're already preforking, then why not use DBIC or any other DBI module? Are you using POE in the forked children or just the parent?
>
> Hope you'll find POE a good fit for your program :)
>
> ~Apocalypse
>
> Markus Jansen wrote:
>
>> Hi POE experts,
>>
>> is there someone who has used POE in an asynchronous way with DBI,
>> without the necessity to reinvent the wheel, with some example or
>> recipe at hand?
>>
>> To illustrate my problem:
>> PoCo::SimpleDBI looks nice, but I am not too sure how well this
>> behaves inside a forking environment (prefork server).
>> DBIx::Connector claims to be great on the prefork matter, but I don't
>> see an asynchronous POE example or recipe somewhere.
>> DBIx::Class claims to be even greater for non-SQL addicts, and seems
>> to have some code in common with DBIx::Connector, but again I fail how
>> to integrate that best into a POE environment ...
>>
>> Any hints / comments are highly welcome!
>>
>> Best regards,
>> Markus
>>
>>
>>
>> *Markus Jansen*
>>
>> Ericsson GmbH
>> Eurolab R&D
>> Ericsson Allee 1
>> 52134 Herzogenrath, Germany
>> Phone +49 2407 575 5157
>> Fax +49 22407 575 150
>> Mobile +49 172 2742003
>> [email protected]
>> _www.ericsson.com_
>>
>>
>> Ericsson GmbH. Sitz: Düsseldorf. Registergericht: Amtsgericht
>> Düsseldorf, HRB 33012. Geschäftsführer: Stefan Koetz (Vors.), Nils de
>> Baar, Bernd Schmidt. Aufsichtsratsvorsitzender: Anders Runevad.
>>
>> This Communication is confidential. We only send and receive email on
>> the basis of the terms set out at _www.ericsson.com/email_disclaimer_
>> <http://www.ericsson.com/email_disclaimer>.
>>
>>
>>
>> ----------------------------------------------------------------------
>> --
>>
>>
>> ----------------------------------------------------------------------
>> --
>>
>>
>
>