Dancer2::Plugin::Database side effects?
I've replaced all my $dbh = DBI->connect, $sth = $dbh->prepare calls with the Dancer2::Plugin::Database equivalents Before that, when there was interaction with the UI, I would explicitly connect, run all my sql and then disconnect, on every Ajax call . After I switched to Dancer2::Plugin::Database,I have to do the same interaction, for example, clicking a button which invokes an Ajax call which in turn calls the database retrieving the new data and updates the UI, does not have an immediate effect ,the UI is not being updated. So I have to do the same move (click a second time) for getting the desirable outcome Has that something to do with caching and reusing the connection?
On 09/23/2015 01:28 PM, Mike Cu wrote:
I've replaced all my $dbh = DBI->connect, $sth = $dbh->prepare calls with the Dancer2::Plugin::Database equivalents Before that, when there was interaction with the UI, I would explicitly connect, run all my sql and then disconnect, on every Ajax call .
After I switched to Dancer2::Plugin::Database,I have to do the same interaction, for example, clicking a button which invokes an Ajax call which in turn calls the database retrieving the new data and updates the UI, does not have an immediate effect ,the UI is not being updated. So I have to do the same move (click a second time) for getting the desirable outcome
Has that something to do with caching and reusing the connection?
It shouldn't - how does your code for the Ajax call looks like? Regards Racke -- Perl and Dancer Development Visit our Perl::Dancer conference 2015. More information on https://www.perl.dance.
It's nothing special :$( "#City" ).selectmenu({ select: function( event, ui ) { $.ajax({ url: '/cities', type: "POST", data: {'City':$("#City" ).val()}}).success(function(data){ $("#display").html(data);}); }, }); I don't know how related it can be,as I've just reverted to the old pre Plugin code and everything works fine.When I use the Plugin I get those side effects On Wednesday, September 23, 2015 3:13 PM, Stefan Hornburg (Racke) <racke@linuxia.de> wrote: On 09/23/2015 01:28 PM, Mike Cu wrote:
I've replaced all my $dbh = DBI->connect, $sth = $dbh->prepare calls with the Dancer2::Plugin::Database equivalents Before that, when there was interaction with the UI, I would explicitly connect, run all my sql and then disconnect, on every Ajax call .
After I switched to Dancer2::Plugin::Database,I have to do the same interaction, for example, clicking a button which invokes an Ajax call which in turn calls the database retrieving the new data and updates the UI, does not have an immediate effect ,the UI is not being updated. So I have to do the same move (click a second time) for getting the desirable outcome
Has that something to do with caching and reusing the connection?
It shouldn't - how does your code for the Ajax call looks like? Regards Racke -- Perl and Dancer Development Visit our Perl::Dancer conference 2015. More information on https://www.perl.dance. _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
On 09/23/2015 06:08 PM, Mike Cu wrote:
It's nothing special : $( "#City" ).selectmenu({ select: function( event, ui ) { $.ajax({ url: '/cities', type: "POST", data: {'City':$("#City" ).val()}}).success(function(data){ $("#display").html(data);}); },
});
I don't know how related it can be,as I've just reverted to the old pre Plugin code and everything works fine.When I use the Plugin I get those side effects
Sorry, I meant the (Dancer) code using the plugin - which is the part that obviously makes the difference. Regards Racke -- Perl and Dancer Development Visit our Perl::Dancer conference 2015. More information on https://www.perl.dance.
forget about it.found it,my badthanks On Wednesday, September 23, 2015 8:44 PM, Stefan Hornburg (Racke) <racke@linuxia.de> wrote: On 09/23/2015 06:08 PM, Mike Cu wrote:
It's nothing special : $( "#City" ).selectmenu({ select: function( event, ui ) { $.ajax({ url: '/cities', type: "POST", data: {'City':$("#City" ).val()}}).success(function(data){ $("#display").html(data);}); }, });
I don't know how related it can be,as I've just reverted to the old pre Plugin code and everything works fine.When I use the Plugin I get those side effects
Sorry, I meant the (Dancer) code using the plugin - which is the part that obviously makes the difference. Regards Racke -- Perl and Dancer Development Visit our Perl::Dancer conference 2015. More information on https://www.perl.dance. _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
Mike Cu, just to let you know, in this thread each one of the messages you sent ended up in the spam folder of my Gmail account. Even after I marked the previous ones as "not spam". The e-mails from other people got into my indbox. The report Gmail gave me was: "It has a from address in yahoo.com but has failed yahoo.com's required tests for authentication. " and linked to this explanation: https://support.google.com/mail/answer/1366858?hl=en&expand=5 I don't know why did this happen, but it might happen with other recipients using gmail. regards Gabor
On Thu, 2015-09-24 at 07:17 +0300, Gabor Szabo wrote:
just to let you know, in this thread each one of the messages you sent ended up in the spam folder of my Gmail account. Even after I marked the previous ones as "not spam". The e-mails from other people got into my indbox. The report Gmail gave me was:
"It has a from address in yahoo.com but has failed yahoo.com's required tests for authentication. "
and linked to this explanation: https://support.google.com/mail/answer/1366858?hl=en&expand=5
I don't know why did this happen,
It's because Yahoo sign their outgoing emails with DMARC, which basically makes them unsuitable for use with mailing lists (the mailing list is not authorised to send emails on the user's behalf, which is essentially what is happening here). There are messy workarounds for mailing lists, but in the short term I wouldn't use a Yahoo email address with a mailing list. Gmail will be making the same change sometime next year, but hopefully by then ARC will be implemented which will provide a potential fix. Andy
participants (4)
-
Andrew Beverley -
Gabor Szabo -
Mike Cu -
Stefan Hornburg (Racke)