Re: [sqlite] Progress callback and nested queries

2011-11-03 Thread Duquette, William H (318K)
On 11/2/11 10:01 PM, "Dan Kennedy"  wrote:


>On 11/03/2011 01:11 AM, Duquette, William H (318K) wrote:
>> I'm pretty sure I know the answer to this.
>>
>> Sqlite3 allows you to define a "progress" callback, which will be
>>called every so many byte-code instructions during a long-running query,
>>so that you can update a progress bar or like that.
>>
>> I'm assuming that querying the same database using the same handle
>>during a "progress" callback would be a *bad* idea.  Am I mistaken?
>
>The docs here say you're not supposed to (last paragraph):
>
>   http://www.sqlite.org/c3ref/progress_handler.html
>
>Dan.

Yeah, I thought as much.  I had a wild quick-and-dirty idea that I thought
better of almost immediately, but it got me curious.

Thanks very much!

Will


>___
>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] Progress callback and nested queries

2011-11-02 Thread Dan Kennedy

On 11/03/2011 01:11 AM, Duquette, William H (318K) wrote:

I'm pretty sure I know the answer to this.

Sqlite3 allows you to define a "progress" callback, which will be called every 
so many byte-code instructions during a long-running query, so that you can update a 
progress bar or like that.

I'm assuming that querying the same database using the same handle during a 
"progress" callback would be a *bad* idea.  Am I mistaken?


The docs here say you're not supposed to (last paragraph):

  http://www.sqlite.org/c3ref/progress_handler.html

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


Re: [sqlite] Progress callback and nested queries

2011-11-02 Thread Pavel Ivanov
> I'm assuming that querying the same database using the same handle during a 
> "progress" callback would be a *bad* idea.  Am I mistaken?

That would deadlock on handle's internal mutex or corrupt the handle
if your SQLite is compiled without multi-threading support.


Pavel


On Wed, Nov 2, 2011 at 2:11 PM, Duquette, William H (318K)
 wrote:
> I'm pretty sure I know the answer to this.
>
> Sqlite3 allows you to define a "progress" callback, which will be called 
> every so many byte-code instructions during a long-running query, so that you 
> can update a progress bar or like that.
>
> I'm assuming that querying the same database using the same handle during a 
> "progress" callback would be a *bad* idea.  Am I mistaken?
>
> Will
> --
> Will Duquette -- william.h.duque...@jpl.nasa.gov
> Athena Development Lead -- Jet Propulsion Laboratory
> "It's amazing what you can do with the right tools."
>
> ___
> 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