[DB-SIG] Re: How to handle database warnings ?

M.-A. Lemburg mal@lemburg.com
Wed, 25 Jul 2001 12:06:22 +0200


Federico Di Gregorio wrote:
> 
> On 24 Jul 2001 13:14:29 +0200, M.-A. Lemburg wrote:
> [snip]
> > Now what about the connection object and messages generated during
> > connection object creation ?
> >
> > I have a feeling that connection objects should automatically
> > clear messages when entering any of the standard connection object
> > methods. Messages created during connection creation will then be
> > available in the connection.messages list after creation.
> 
> i don't see anything bad with that. seems good to me. err.. i agree. :)

FYI, I've started integrating this into mxODBC. I found that most
cursor object methods except the .fetchXXX() APIs will have to 
implement the automatic message clearing. The .close() method is
interesting in this respect: it will clear the list *before* closing
the cursor.

For the connection object I chose to not implement auto-clearing
for the connection option and .getinfo() methods (these are mxODBC
specific) since these are likely to be used during warning
processing.

Also, the message list will include all messages generated by the
ODBC driver, not only warnings, but error messages too and it
will only store the error object class and value, not the instantiated
error object itself (this would be too costly).

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/