Perl 6 - the future is here, just unevenly distributed

IRC log for #askriba, 2017-11-24

| Channels | #askriba index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
07:10 karjala_ joined #askriba
08:32 karjala_ joined #askriba
09:39 karjala_ It seems that if the mysql connection gets dropped (eg if mysql is restarted), all further SQL commands done with $schema will fail with an error until the process ends. Am I wrong?
09:41 karjala_ Does that mean that I should write logic around each web request that tests whether database connection is alive, and if not reconnects?
09:44 karjala_ Otherwise I might end up having the webserver failing every webrequest (if the connection has been dropped)
09:45 karjala_ (for half a minute)
09:54 karjala_ I can provide code that shows what I mean, if you want.
10:10 karjala_ ribasushi, here's my problem: https://gist.github.com/akarelas-pt/eea93b8146789acb69e7d07640ae6768
10:10 karjala_ I would expect record 3 to be created.
11:30 karjala_ Maybe I should use DBIx::Error to detect errors that have happened because of connection dropping, so I can have my program re-connect in that case?
11:31 karjala_ But I see that DBIx::Error has an old issue with DBIx::Class
11:31 karjala_ submitted by you
11:34 karjala_ So maybe I shouldn't. What should I do?
11:54 karjala_ MySQL doesn't work very well with DBIx::Error (because the server I have doesn't return SQLSTATE other than "General Error"), so I have to skip that solution
11:54 karjala_ What else can I do?
12:21 karjala_ I ended-up writing this line inside my catch {} block:     $schema->storage->connected     or $schema = My::Schema->my_connect;
12:22 karjala_ I think that solves the problem (except for the fact that the DBIC POD says that ->connected might be very expensive for some storage engines)
12:22 karjala_ If you find a better solution for me, please do let me know
13:05 Relequestual joined #askriba
21:46 karjala_ joined #askriba

| Channels | #askriba index | Today | | Search | Google Search | Plain-Text | summary