[Dbix-class] Proper way to suppress die from DBIx::Class

Peter Rabbitson rabbit+dbic at rabbit.us
Wed Oct 15 16:01:41 GMT 2014


On 10/15/2014 04:55 PM, Sean Quinlan wrote:
> The end result I want is to not have to wrap every update / insert / etc
> with an eval.
>
> I have no problem if DBIC internals use exception-based control
> internally. I just want to optionally have it not bubble up to the level
> of my application. It would be far more elegant if I could have DBIC
> play nicely with our applications exception handling, rather than have
> to insulate every usage manually.
>

This is a reasonable (albeit architecturally unsound) request. If the 
'unsafe' handling is requested everything not happening in a transaction 
should indeed not result in exceptions.

In order to go forward with this I will need a modest set of lives_ok 
checks for various operations. The actual implementation will be more 
involved and will likely be carried out by me or another core contrib. 
For a concise test example, take a look at
https://github.com/dbsrgits/dbix-class/blob/current/for_cpan_index/t/schema/anon.t

Let me know if you have any further questions

Cheers!



More information about the DBIx-Class mailing list