On 24 Nov 2010, at 3:08am, Pavel Ivanov wrote:
> Probably SQLite's implementation allows some other types of behavior,
> but in any case behavior would be "erroneous" and unpredictable, so
> you better avoid changing table that is currently being selected, or
> at very least avoid changing indexe
> Could there be any other
> consequences like unpredictable behavior and such?
Yes, it will be unpredictable and undefined behavior.
I can't say exactly how SQLite will behave in such situation. What I
know is it doesn't execute all select at once, it fetches row by row
on each sqlite3_step call
Pavel,
What will happen if you had an index on the other_column for the
select/update you mentioned below? Is it just that your tree will be
unbalanced every time you change the other_column? Could there be any other
consequences like unpredictable behavior and such?
Thanks
> Exactly t
Nikolaus Rath wrote:
> "Igor Tandetnik" writes:
>> Nikolaus Rath wrote:
>>> I understand that running INSERT or DELETE during an active SELECT query
>>> can get me into trouble. But is it safe to run (in pseudocode):
>>>
>>> for value in "SELECT main_column IN mytable":
>>>
>>> UPDATE mytabl
> for value in "SELECT main_column IN mytable":
> UPDATE mytable SET other_column='foobar' WHERE main_column=value
Exactly this sequence is safe. Things can go nuts in case if you have
index on other_column and you do something like this:
for value in "SELECT main_column IN mytable WHERE other_
"Igor Tandetnik" writes:
> Nikolaus Rath wrote:
>> I understand that running INSERT or DELETE during an active SELECT query
>> can get me into trouble. But is it safe to run (in pseudocode):
>>
>> for value in "SELECT main_column IN mytable":
>>
>> UPDATE mytable SET other_column='foobar' WHE
Nikolaus Rath wrote:
> I understand that running INSERT or DELETE during an active SELECT query
> can get me into trouble. But is it safe to run (in pseudocode):
>
> for value in "SELECT main_column IN mytable":
>
> UPDATE mytable SET other_column='foobar' WHERE main_column=value
It should be
Hello,
I understand that running INSERT or DELETE during an active SELECT query
can get me into trouble. But is it safe to run (in pseudocode):
for value in "SELECT main_column IN mytable":
UPDATE mytable SET other_column='foobar' WHERE main_column=value
?
Thanks,
-Nikolaus
--
»Time
[EMAIL PROTECTED] wrote:
John Stanton <[EMAIL PROTECTED]> wrote:
Yes, each connection has a cache. A lot of concurrent connections means
a lot of memory allocated to cache and potentially a lot of duplicated
cached items. See shared cache mode for relief.
Yes. But remember that shared
John Stanton <[EMAIL PROTECTED]> wrote:
>
> Yes, each connection has a cache. A lot of concurrent connections means
> a lot of memory allocated to cache and potentially a lot of duplicated
> cached items. See shared cache mode for relief.
>
Yes. But remember that shared cache mode has limit
[EMAIL PROTECTED] wrote:
> A single connection can only be used by a single thread at
> a time. If you have multiple threads running at the same
> time, they each need to have their own connection.
>
> If you are not running on a Linux 2.4 kernel, then you can
> pass connections from one thread
[EMAIL PROTECTED] wrote:
Joe Wilson <[EMAIL PROTECTED]> wrote:
--- John Stanton <[EMAIL PROTECTED]> wrote:
Using a single Sqlite connection for each database and holding the
connection open means that maximum effect is obtained from Sqlite's
cache. As far as we can ascertain avoiding fcntl
--- [EMAIL PROTECTED] wrote:
> A single connection can only be used by a single thread at
> a time. If you have multiple threads running at the same
> time, they each need to have their own connection.
>
> If you are not running on a Linux 2.4 kernel, then you can
> pass connections from one thre
Joe Wilson <[EMAIL PROTECTED]> wrote:
> --- John Stanton <[EMAIL PROTECTED]> wrote:
> > Using a single Sqlite connection for each database and holding the
> > connection open means that maximum effect is obtained from Sqlite's
> > cache. As far as we can ascertain avoiding fcntl removes any issu
If I am stepping through the results of a SELECT and want to UPDATE values in
the currently selected row prior to completion of the SELECT query, will this
work?
What if there is already a pending writer lock on the database from a different
thread?
Thanks.
Larry
---
15 matches
Mail list logo