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. |