--- Joe Wilson <[EMAIL PROTECTED]> wrote:
> --- [EMAIL PROTECTED] wrote:
> > Ran <[EMAIL PROTECTED]> wrote:
> > > Hi all,
> > > 
> > > I *think* that sqlite3_close behave strangly.
> > > 
> > > I use version 3.3.7 on Linux (Fedora Core 5).
> > > 
> > > What I do is to open a database, and start a transaction in it. Then,
> > > without ending the transaction, open again the database and simply close 
> > > it.
> > > 
> > > I found out, that the inner sqlite3_close return 0 (SQLITE_OK), but the
> > > file handle is not released. So if I do it too many times, I run out of 
> > > file
> > > handles.
> > > 
> > 
> > This behavior is intentional.  It is a work-around for a bug
> 
> SQLite should find the inode of the database file via stat()'s st_ino 
> field prior to open() and if it is the same as an already opened
> database file, it should use the same (refcounted) file descriptor,
> eliminating the need for open() in this case.

st_dev is needed to be checked as well...
st_ino and st_dev are both required to uniquely identify regular files.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to