Re: [Libreoffice-qa] error checking in Base ODBC

2011-10-24 Thread Caolán McNamara
On Sat, 2011-10-22 at 11:11 -0400, Terrence Enger wrote:
 Hmm.  Is my question really of no interest?  Or did I just time it 
 badly with respect to the big conference?

It's the wrong list really, libreoffice-dev is a better choice than
libreoffice-qa for what is fundamentally a code level question.

And it'd be easier for someone to see what you're talking about exactly,
e.g. line numbers and source files if you attached e.g. the sample patch
you were talking about at the time. Sounds like we should call
SQLDisconnect anyway.

C.

___
List Name: Libreoffice-qa mailing list
Mail address: Libreoffice-qa@lists.freedesktop.org
Change settings: http://lists.freedesktop.org/mailman/listinfo/libreoffice-qa
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://lists.freedesktop.org/archives/libreoffice-qa/


Re: [Libreoffice-qa] error checking in Base ODBC

2011-10-22 Thread Terrence Enger
Hmm.  Is my question really of no interest?  Or did I just time it 
badly with respect to the big conference?

Terry.

On Fri, 2011-10-14 at 09:50 -0400, Terrence Enger wrote:
 I notice that at least some calls from Base to ODBC routines
 fail to check the return code, and I wonder what we should
 be doing.
 
 
 The particular situation that caught my interest arises this
 way ...
 (*) Base allocates and uses a connection handle.  
 (*) Upon closing the database, the code tries to free that
 handle without calling SQLDisconnect.  SQLFreeHandle
 returns -1 (SQL_ERROR), and sets sqlstate HY010
 (function sequence error).
 (*) The statistics tab of ODBCConfig (part of unixODBC on
 ubuntu-natty) shows that one connection is allocated.
 
 A call to SQLDisconnect before the call to SQLFreeHandle
 within OConnection::~OConnection() has worked once(!)
 without causing obvious difficulties.
 
 
 ( Aside to the kind people who were discussing automated
 testing with me last week:  I anticipate that leaked
 connection handles could cause difficulty in the context of
 automated tests, either from opening and closing many
 databases within one instance of soffice.bin, or from a
 driver manager less generous with handles than the one I am
 using here now.  See, folks, I have not been ignoring you
 just for the sake of ignoring you grin /. )
 
 
 What else should the code generally do?  Should we continue
 to ignore errors?  (After all, I only noticed the particular
 situation because I am nasty person who is just looking for
 trouble grin /.)  Should we be asserting adequately good
 return values?  We could collect diagnostic information, if
 we knew how to get the attention of somebody who cares.  Can
 we even think about throwing exceptions from a low-level
 wrapper around the ODBC routine?
 
 
 Thank you, all, for your patience with a troublemaker.
 Terry.


___
List Name: Libreoffice-qa mailing list
Mail address: Libreoffice-qa@lists.freedesktop.org
Change settings: http://lists.freedesktop.org/mailman/listinfo/libreoffice-qa
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://lists.freedesktop.org/archives/libreoffice-qa/