[Dbix-class] txn_do on a custom ResultSource gets unbound
placeholder exception
Cedric Boudin
cedric at dreamgnu.com
Fri Feb 1 12:28:07 GMT 2008
Dear members of the list.
I have a custom resultsource calling a db function with 4 input
parameters returning a set of rowtypes.
This resultsource is build as described in
DBIx::Class::Manual::Cookbook
Arbitrary SQL through a custom ResultSource
case a)
When I use this resultsource to get a resultset executing the function,
everything works as expected.
The function does what it is supposed to do and returns the expected
values.
These values are accessible through the normal methods/accessors.
Everything is fine.
as the function throws an exception when something goes wrong I want to
catch it, so then I do as explained in
DBIx/Class/Storage.pm#txn_do
case b)
and wrap the call to the method calling the db function in a sub.
I pass the sub's coderef to txn_do.
The call to the method is exactly the same in case a as in case b.
But in this case I end up with an unbound placeholder exception.
Stepping through the code execution with the debugger I come to the
conclusion that the call to
DBIx::Class::Storage::DBI::_execute
in case a
the parameter $extra_bind contains the values given in the bind=>[ arg1,
arg2,arg3...] argument used to call the custom resultsource
in case b the the extra_bind is desperatedly empty.
is this an expected behaviour or did I hit some bug?
Need more info scream, I'll be happy to provide.
cedric
More information about the DBIx-Class
mailing list