I was thinking of rewriting Cayenne operation pipeline to be closer to 
something that we have in Agrest (agrest.io, ex. LinRest), were the context for 
the entire operation is readily available, with all the intermediate states. 
The current pipeline doesn't keep this info (as you've noticed). 

So yeah, a short-term solution is to turn on the logging (I always do, so I 
never had this problem). Maybe a medium-term solution would be to catch the 
exception where the SQL is still known, log the SQL at the ERROR level and 
rethrow.

Andrus


> On Oct 29, 2018, at 2:05 AM, Maik Musall <m...@selbstdenker.ag> wrote:
> 
> Hi,
> 
> I sometimes have inserts or updates failing that are totally ok to fail, like 
> a numeric field overflow or something. My problem: I have a callstack, but 
> not the actual values that were being attempted to store.
> 
> I use a custom saveChanges() method in my custom ObjectContext subclass that 
> wraps commitChangesToParent(). I could try/catch that and log something if it 
> fails, but I don't see a way to access the actual SQL or loggable graph diff 
> at that point. Is there (beyond turning on SQL logging in general)?
> 
> Using Cayenne 4.0.
> 
> Thanks
> Maik
> 

Reply via email to