ap / DBIx-Connector

Fast, safe DBI connection and transaction management
https://metacpan.org/release/DBIx-Connector
40 stars 14 forks source link

Plack #10

Closed forwardever closed 13 years ago

forwardever commented 13 years ago

using a Plack based framework, I get the following error if there is NO database connection (no mysql instance started on windows). Not even sure if this is a bug, so close this issue if the behaviour is expected:

Plack error message:

The application raised the following error: and the StackTrace middleware couldn't catch its stack trace, possibly because your application overrides $SIG{DIE} by itself, preventing the middleware from working correctly. Remove the offending code or module that does it: known examples are CGI::Carp and Carp::Always.

Code:

# Create a connection.
my $conn = DBIx::Connector->new('dbi:mysql:', 'user', 'pass', {
    RaiseError => 1,
});

# Do something with the handle more efficiently.
$conn->run(sub {
    $_->do('INSERT INTO foo (name) VALUES (?)', undef, 'Fred' );
});

Everything works fine with slightly modified code (i.e. Stacktrace works without any problems)

$conn->run(sub {
    $_->do( fixup => 'INSERT INTO foo (name) VALUES (?)', undef, 'Fred' );
});
theory commented 13 years ago

Wrong ticket closed, sorry.

theory commented 13 years ago

I believe that this is an issue with PadWalker. See this ticket for details. Try applying @rafl's patch in that ticket to see if it fixes the issue.

theory commented 13 years ago

Oh, no patch there. @rafl, is rafl/PadWalker@22f844cbae57263eb1d0bcfde610af24ad62b626 the correct fix? It's a different RT but seems closely related…

rafl commented 13 years ago

That's the fix for RT#55242.

http://gist.github.com/964912 has the fix for this issue.

theory commented 13 years ago

Thanks, @rafl. Man, seems like we need a new release of PadWalker.

David