I have a custom version of batcher implemented, derived from
AbstractBatcher where I'm making sure that DbException is correctly
catched and exception.Data["actual-sql-query"] is assigned to a full
query string so that I can see it in the log (in the same way as it is
done in AbstactBatcher, search for "actual-sql-query").

The problem is that AbstractEntityPersister catches all DbExceptions
and then it creates a new exception with a help of ADOExceptionHelper.
But on the way it overrides my query with its own one in a form:

"SQL: DELETE FROM features WHERE id = ?].

As a result I'm missing actual value in "id=?" in the log. In my
"actual-sql-query" SQL string is defined as:

"DELETE FROM features WHERE id = @p0; Parameter Values: @p0=6"

which is a bit more informative.

Looks like a small inconsistency to me. AbstractEntityPersister
probably should pass on "actual-sql-query" if it is defined instead of
skipping it. Or at least it should log actual id.



Reply via email to