我运行一个高效应用程序来管理我们研究组的出版物。该应用程序是在perl中用mojolicious框架编写的。我使用sqlite3作为数据库,Hypnotoad作为应用服务器。与DB偶尔崩溃的Mojolicious连接
我的问题是,连接到数据库偶尔会崩溃(每周2次),而没有提供合理的错误消息。唯一有帮助的是重新启动Hypnotoad。任何想法为什么这可能发生?一个错误消息的
实施例:
[Fri Jan 16 08:43:09 2015] [error] Can't call method "execute" on an undefined value at /home/piotr/perl/publiste2/script/../lib/AdminApi/Core.pm line 525.
的代码有如下所示:
DBI->connect('dbi:SQLite:dbname='.$config->{normal_db}, '', '') or die $DBI::errstr .". File is: ".$config->{normal_db};
完整代码是可用的:
my $qry = "SELECT DISTINCT our_type FROM OurType_to_Type WHERE landing=1 ORDER BY our_type ASC";
my $sth = $dbh->prepare($qry);
$sth->execute(); # this is the line 525
胸径变量由助手返回这里:https://bitbucket.org/vikin9/hex64publicationlistmanager/src
我会试试这个,并等待下一次崩溃,看看错误消息说什么。 – Piotr
我检查了它,$ dbh-> errstr是空的。 – Piotr