Re: [sqlite] sqlite3_open_v2 and SQLITE_BUSY

2009-05-07 Thread Dan

On May 8, 2009, at 4:37 AM, Igor Tandetnik wrote:

> Steven Fisher  wrote:
>> I was looking over the requirements for sqlite3_open_v2(), and I'm  
>> not
>> clear if this function can ever return SQLITE_BUSY.
>
> I don't believe so. As far as I know, it doesn't actually touch the  
> file
> at all, so it won't even return I/O errors (the file is physically
> opened and read when you prepare your first non-PRAGMA statement).

The file is opened when sqlite3_open_v2() is called. And I think a  
couple
of trivial methods are called - xSectorSize() and  
xDeviceCharacteristics().
But that's all, nothing is read, written or locked until later on.

So you won't get SQLITE_BUSY back from sqlite3_open_v2(). You might  
manage
an SQLITE_CANTOPEN if you tried to open a directory or, depending on the
flags passed to open_v2(), a file that does not exist.

Dan.



> Igor Tandetnik
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_open_v2 and SQLITE_BUSY

2009-05-07 Thread Igor Tandetnik
Steven Fisher  wrote:
> I was looking over the requirements for sqlite3_open_v2(), and I'm not
> clear if this function can ever return SQLITE_BUSY.

I don't believe so. As far as I know, it doesn't actually touch the file 
at all, so it won't even return I/O errors (the file is physically 
opened and read when you prepare your first non-PRAGMA statement).

Igor Tandetnik 



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3_open_v2 and SQLITE_BUSY

2009-05-07 Thread Steven Fisher
I was looking over the requirements for sqlite3_open_v2(), and I'm not  
clear if this function can ever return SQLITE_BUSY.

I initially wrote code to handle this case by sleeping and trying  
sqlite3_open_v2() again, but it is untested and I've spotted one bug  
in it already (I wasn't calling sqlite3_close in this case). If I can,  
I'd like to get rid of the code utterly.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users