I don't think you need to propagate warnings. In most cases they can be 
ignored. They are not converted into exceptions by database engine and in 
those rare cases when user wants them, he can call 
getWarnings()<http://stackoverflow.com/questions/6434338/when-to-call-getwarnings-on-connections-statements-and-resultsets-with-jdbc>to
 check if there are any warnings. Actually... If I were a developer of 
Java database classes, I would introduce an option to throw warnings as 
exceptions. I like clean code. I don't want even warnings to be there as a 
result of query execution.

воскресенье, 15 апреля 2012 г., 13:44:23 UTC+4 пользователь Lukas Eder 
написал:
>
> Hi Vladislav,
>
> > So, IGNORE causes INSERT not to raise any error on any error :) 
> Actually, I
> > don't really like this behavior since it swallows errors. Warnings are
> > usually not properly handled by error-handling code in most APIs.
>
> Thanks for your insight. You're right, I guess it is up to the user to
> assess whether they want to make wise use of the IGNORE clause. Other
> databases have a much more powerful MERGE statement, to handle all
> similar cases:
>
> MERGE INTO table
> USING (...) ON (...)
> WHEN NOT MATCHED THEN INSERT (...)
>
> A bit more verbose, yet very precise. For jOOQ, I'm sure it makes
> sense to support MySQL's IGNORE clause, for those rare cases where
> this makes sense... Do you think, jOOQ should propagate these
> "warnings"? As I understand it, they can be safely ignored...?
>
> Cheers
> Lukas
>
>

Reply via email to