Re: [sqlite] Nesting Read/Write within Transaction?

2010-02-12 Thread Marcus Grimm
>
>>The only thing that can bite you is if
>>you are in process of fetching rows from some select statement and you
>>update row that was just fetched or update/insert rows that would have
>>been fetched later by the select statement.
>
> As I understand it, simply wrapping every batch operation (Read, Write
> or Read_Modify_Write) inside an IMMEDIATE transaction is all that's
> needed to prevent such bad things from happening, or am I misguided?

It doesn't matter if you are in a transaction or not, changing
rows while inside a fetch loop on the same table may lead
to problems.
DRH gave a nice explanation about this issue:

http://www.mail-archive.com/sqlite-users@sqlite.org/msg44025.html

Marcus

>
> ___
> 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] Nesting Read/Write within Transaction?

2010-02-12 Thread Jean-Christophe Deschamps

>The only thing that can bite you is if
>you are in process of fetching rows from some select statement and you
>update row that was just fetched or update/insert rows that would have
>been fetched later by the select statement.

As I understand it, simply wrapping every batch operation (Read, Write 
or Read_Modify_Write) inside an IMMEDIATE transaction is all that's 
needed to prevent such bad things from happening, or am I misguided?

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


Re: [sqlite] Nesting Read/Write within Transaction?

2010-02-12 Thread Pavel Ivanov
Yes, they are perfectly valid. The only thing that can bite you is if
you are in process of fetching rows from some select statement and you
update row that was just fetched or update/insert rows that would have
been fetched later by the select statement. This is generally a bad
thing to do and behavior of SQLite in such case is undefined.

Pavel

On Fri, Feb 12, 2010 at 12:09 PM, dv74  wrote:
>
> I need a confirmation that these operations (i.e reading back the rows, that
> were just modified/inserted while the transaction is occuring) are valid and
> will not bite me in the long run.
>
>
>
> Pavel Ivanov-2 wrote:
>>
>> Besides the fact that I don't understand what you have meant by these
>> lines:
>>
>>>     Select * from table where lookup_key = "ABC"
>>>     append save results to my list.
>>
>> I don't see anything unusual in your algorithm. What do you want us to
>> verify (which you cannot verify yourself) and what do you find unusual
>> in your actions?
>>
>> Pavel
>>
>
> --
> View this message in context: 
> http://old.nabble.com/Nesting-Read-Write-within-Transaction--tp27565519p27566601.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> ___
> 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] Nesting Read/Write within Transaction?

2010-02-12 Thread dv74

I need a confirmation that these operations (i.e reading back the rows, that
were just modified/inserted while the transaction is occuring) are valid and
will not bite me in the long run.



Pavel Ivanov-2 wrote:
> 
> Besides the fact that I don't understand what you have meant by these
> lines:
> 
>>     Select * from table where lookup_key = "ABC"
>>     append save results to my list.
> 
> I don't see anything unusual in your algorithm. What do you want us to
> verify (which you cannot verify yourself) and what do you find unusual
> in your actions?
> 
> Pavel
> 

-- 
View this message in context: 
http://old.nabble.com/Nesting-Read-Write-within-Transaction--tp27565519p27566601.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] Nesting Read/Write within Transaction?

2010-02-12 Thread Pavel Ivanov
Besides the fact that I don't understand what you have meant by these lines:

>     Select * from table where lookup_key = "ABC"
>     append save results to my list.

I don't see anything unusual in your algorithm. What do you want us to
verify (which you cannot verify yourself) and what do you find unusual
in your actions?

Pavel

On Fri, Feb 12, 2010 at 10:50 AM, dv74  wrote:
>
> Hi ,
>  After reading http://sqlite.org/atomiccommit.html I think I should be able
> to do the following without any hiccups:
>
> Begin Transaction
>    For all tables
>      Select * from table where lookup_key = "ABC"
>          for selected rows update certain column
>      insert new rows with lookup_key = "ABC"
>     Select * from table where lookup_key = "ABC"
>     append save results to my list.
> End Transaction
>
>
> Can you please verify this.
>
> Thank you.
> --
> View this message in context: 
> http://old.nabble.com/Nesting-Read-Write-within-Transaction--tp27565519p27565519.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> ___
> 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


[sqlite] Nesting Read/Write within Transaction?

2010-02-12 Thread dv74

Hi ,
 After reading http://sqlite.org/atomiccommit.html I think I should be able
to do the following without any hiccups:

Begin Transaction
For all tables
  Select * from table where lookup_key = "ABC"
  for selected rows update certain column
  insert new rows with lookup_key = "ABC"
 Select * from table where lookup_key = "ABC"
 append save results to my list.
End Transaction
   

Can you please verify this.

Thank you.
-- 
View this message in context: 
http://old.nabble.com/Nesting-Read-Write-within-Transaction--tp27565519p27565519.html
Sent from the SQLite mailing list archive at Nabble.com.

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


[sqlite] Nesting Read/Transactions

2010-02-12 Thread dv74


-- 
View this message in context: 
http://old.nabble.com/Nesting-Read-Transactions-tp27565385p27565385.html
Sent from the SQLite mailing list archive at Nabble.com.

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


[sqlite] SQLite 3.6.22 no longer by default threadsafe on Linux

2010-02-12 Thread Peter Klotz
configure claims a default build of SQLite 3.6.22 is threadsafe:

./configure --help
...
--enable-threadsafe build a thread-safe library [default=yes]
...

However a diff between configures of 3.6.19 and 3.6.22 says otherwise:

diff sqlite-3.6.19/configure sqlite-3.6.22/configure
...
21023c21023
<   enable_threadsafe=yes
---
>   enable_threadsafe=no


I suggest that either the output of configure is changed or the default is 
reverted back to a threadsafe build.

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


Re: [sqlite] Error: no such table on .import

2010-02-12 Thread Griggs, Donald

sqlite> .import C:\HEAD.txt head;
Error: no such table: head;
Any idea why I'm getting "no such table"?

Hi Phil,

The "dot" commands -- such as .import -- don't require a semicolon terminator, 
and the utility is interpreting your trailing semicolon as part of the table 
name.

You may also want to surround 'c:\head.txt' with single quotes, but I think if 
you omit the semicolon you'd finally get ahead with your work.

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


Re: [sqlite] Error: no such table on .import

2010-02-12 Thread Phil Hibbs
> because of the semicolon following the table name in your .import -
> command. Remove it.

Yes, I was just about to reply saying I'd spotted that. Funny how
after half an hour of scratching your head, you post to a mailing list
and then spot it immediately. Thanks and apologies.

Phil Hibbs.
-- 
Don't you just hate self-referential sigs?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error: no such table on .import

2010-02-12 Thread Martin Engelschalk
Hi,

because of the semicolon following the table name in your .import - 
command. Remove it.

Martin

Phil Hibbs wrote:
> I'm doing this in SQLite:
>
> sqlite> .separator tabs
> sqlite> create table head
>...> ( id varchar(10)
>...> , tplnr varchar(20)
>...> , plnal varchar(2)
>...> , ktext varchar(40)
>...> , arbpl varchar(10)
>...> , werks varchar(4)
>...> , verwe varchar(1)
>...> , vagrp varchar(3)
>...> , statu varchar(1)
>...> , sttag varchar(8)
>...> , strat varchar(6)
>...> , batchno varchar(3)
>...> );
> sqlite> .import C:\HEAD.txt head;
> Error: no such table: head;
> sqlite> .schema
> CREATE TABLE head
> ( id varchar(10)
> , tplnr varchar(20)
> , plnal varchar(2)
> , ktext varchar(40)
> , arbpl varchar(10)
> , werks varchar(4)
> , verwe varchar(1)
> , vagrp varchar(3)
> , statu varchar(1)
> , sttag varchar(8)
> , strat varchar(6)
> , batchno varchar(3)
> );
>
> Any idea why I'm getting "no such table"?
>
> Phil Hibbs.
>   
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Error: no such table on .import

2010-02-12 Thread Phil Hibbs
I'm doing this in SQLite:

sqlite> .separator tabs
sqlite> create table head
   ...> ( id varchar(10)
   ...> , tplnr varchar(20)
   ...> , plnal varchar(2)
   ...> , ktext varchar(40)
   ...> , arbpl varchar(10)
   ...> , werks varchar(4)
   ...> , verwe varchar(1)
   ...> , vagrp varchar(3)
   ...> , statu varchar(1)
   ...> , sttag varchar(8)
   ...> , strat varchar(6)
   ...> , batchno varchar(3)
   ...> );
sqlite> .import C:\HEAD.txt head;
Error: no such table: head;
sqlite> .schema
CREATE TABLE head
( id varchar(10)
, tplnr varchar(20)
, plnal varchar(2)
, ktext varchar(40)
, arbpl varchar(10)
, werks varchar(4)
, verwe varchar(1)
, vagrp varchar(3)
, statu varchar(1)
, sttag varchar(8)
, strat varchar(6)
, batchno varchar(3)
);

Any idea why I'm getting "no such table"?

Phil Hibbs.
-- 
Don't you just hate self-referential sigs?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [sqlite-dev] Looking for web interfaced based opensource project using sqlite

2010-02-12 Thread Alexey Pechnikov
Hello!

On Friday 12 February 2010 04:40:21 Vasanta wrote:
> All expert Users and Developers:

Do not sent your mails to sqlite-...@sqlite.org! This produce spam for core 
developers.
And I can't understand you question. What you want to do?

Best regards, Alexey Pechnikov.
http://pechnikov.tel/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users