Hi Xantos, I've made the two options available upon EasyDBI->spawn
POE::Component::EasyDBI->spawn( alias => 'EasyDBI', dsn => "DBI:mysql:database=$mysql_database;host=$mysql +_host;port=3306", username => "$mysql_username", password => "$mysql_password", options => { max_retries => -1, no_connect_failures => 1, }, );
But However, when I do this:
POE::Session->create( inline_states => { _start => sub { print "DEBUG: SQL QUERY START\n"; $_[KERNEL]->post( 'EasyDBI', insert => { sql => "INSERT INTO camincoming (site_id,c +am_id,eventtime,filestamp,filename) VALUES (?,?,current_timestamp,?,? +);", placeholders => [ $input->{site}, $input-> +{dir}, $mysqldate, $input->{filename} ], event => 'result_handler', } ); }, result_handler => sub { print Dumper($_[ARG0]); } } );
Then I start my script which works fine. After I break the connection to MySQL by stopping the mysql. I get the following through result_handler
$VAR1 = { 'sql' => 'INSERT INTO camincoming (site_id,cam_id,eventtime, +filestamp, filename) VALUES (?,?,current_timestamp,?,?);', 'session' => 5, 'error' => 'POE::Component::EasyDBI was shut down forcibly!' +, 'action' => 'insert', 'id' => 0, 'event' => 'result_handler', 'placeholders' => [ '24', '1', '2009-01-20 18:14:40', 'videotrg20090120181644_0.jpg' ] };

after this ... if I start back MySQL ... further nothing happens. I think because the spawned EasyDBI is no longer there. Can you please advice, what I am doing wrong. Thank you very much for your support.

In reply to Re^2: PoCo::EasyDBI reconnect by avo
in thread POCO::EasyDBI reconnect by avo

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.