Re: [sqlite] Writing double into a socket file

2008-06-10 Thread John Stanton
Alex, Thankyou for the comments. I use non-blocking fd's also but implement multiple threads to take advantage of multiple processor servers. Since threads carry quite a bit of baggage your single thread approach would probably be superior on a single processor machine. It has been

[sqlite] How can I count the number of times a word present in text indexed with FTS 3?

2008-06-10 Thread Tito Ciuro
Hello, I was reading the document 'http://www.sqlite.org/cvstrac/wiki?p=FtsUsage' and I was wondering whether there is a way to count the number of times a word is present in text indexed with FTS 3. For example: CREATE VIRTUAL TABLE recipe USING fts3(name, instructions); INSERT INTO

Re: [sqlite] Best Practices

2008-06-10 Thread Stephen Oberholtzer
On Tue, Jun 10, 2008 at 1:29 PM, A. H. Ongun <[EMAIL PROTECTED]> wrote: > We have an application requirement for the following: > 1) Maintain an in memory database of real time data. The main table mimics > a Modbus register address scheme and once the table is created and records > are

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Alex Katebi
John, My server uses epoll( ) and runs non-blocking in a single thread. I did some google and found out that people who need a very fast server that is highly scalable are using this model. non-blocking seems to be more complicated at first glance but it actually makes the server design much

Re: [sqlite] How to build an extension that gets autoloaded

2008-06-10 Thread Alex Katebi
Try this link. http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions On Tue, Jun 10, 2008 at 12:39 AM, Stephen Woodbridge < [EMAIL PROTECTED]> wrote: > Hi all, > > I was reading through the sqlite source and noticed that there appears > to be an ability to build and extension that is

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread John Stanton
We use an application server I wrote which handles HTTP, serves file and has embedded Sqlite for the RPCs. The RPC can deliver its result either in XML for widely distributed applications or as JSON if it is responding to a WWW browser in AJAX mode. We keep a local library of SQL RPCs so that

Re: [sqlite] transaction locks w/ multiple DBs open/ATTACHed(reposted)

2008-06-10 Thread D. Richard Hipp
On Jun 10, 2008, at 7:55 PM, Igor Tandetnik wrote: > D. Richard Hipp <[EMAIL PROTECTED]> wrote: >> On Jun 10, 2008, at 4:04 PM, Robert Lehr wrote: >>> Specifically, does SQLite lock the DBs incrementally, as they are >>> accessed within the transaction? Or does it lock ALL DBs? >> >> Databases

Re: [sqlite] transaction locks w/ multiple DBs open/ATTACHed(reposted)

2008-06-10 Thread Igor Tandetnik
D. Richard Hipp <[EMAIL PROTECTED]> wrote: > On Jun 10, 2008, at 4:04 PM, Robert Lehr wrote: >> Specifically, does SQLite lock the DBs incrementally, as they are >> accessed within the transaction? Or does it lock ALL DBs? > > Databases are locked as needed - incrementally. So this is another

Re: [sqlite] simultaneous transactions

2008-06-10 Thread Igor Tandetnik
Dave Dyer <[EMAIL PROTECTED]> wrote: > I don't understand why the following transaction > behavior is correct or necessary. The question > involves two simultaneous transactions on the same > database > > Process 1 Process 2 > > BEGIN > > BEGIN > > insert... > > insert... fails "locked" > > end

Re: [sqlite] Problem with sqlite overall or not?

2008-06-10 Thread Alex Katebi
I just noticed that you are returning from your function before finalize. On Tue, Jun 10, 2008 at 10:12 AM, piotro <[EMAIL PROTECTED]> wrote: > Hello. I really need help with this, because Im almost out of > ideas here. Help please! > > sqldata is a vector< vector < char* > > > row is a vector <

Re: [sqlite] Problem with sqlite overall or not?

2008-06-10 Thread Alex Katebi
For starters sqlite3_column_count( ) should be after prepare once. You don't need to do it for every step. The other thing is do you have to use STL when you can do everything by using SQLite? Tell us in English what you want to accomplish with your code. We can come up with a pure SQLite

Re: [sqlite] Accessibility dependend on command and folder

2008-06-10 Thread D. Richard Hipp
On Jun 10, 2008, at 5:24 PM, maximi wrote: > > Hi > im using php in a webapp to access a sqlite database. now since > hours i'm > confronted with a weird error: > > i can access my database just fine, as long as i use commands as > simple as > "select * from testtable where a='b'" > as soon

Re: [sqlite] transaction locks w/ multiple DBs open/ATTACHed (reposted)

2008-06-10 Thread D. Richard Hipp
On Jun 10, 2008, at 4:04 PM, Robert Lehr wrote: > I am reposting this question b/c it received no reply previously and > the > answers to my questions will significantly affect our application's > design. > > My current question focuses on SQLite's locking policy for > transactions > on

Re: [sqlite] Problem with sqlite overall or not?

2008-06-10 Thread Neville Franks
Wednesday, June 11, 2008, 12:12:33 AM, you wrote: p> Hello. I really need help with this, because Im almost out of p> ideas here. Help please! p> sqldata is a vector< vector < char* > > p> row is a vector < char* > p> sqldata sql3wrapper::pobierzPodmiot(){ p> const char* tail; p>

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Alex Katebi
Dennis, My servers main connection itself is in :memory:, but your suggestion will still work. However there are two things I don't like about this method. One is that I need to parse the prepared statments and prefix queries, and replace the table name with the temp table name in the

[sqlite] simultaneous transactions

2008-06-10 Thread Dave Dyer
I don't understand why the following transaction behavior is correct or necessary. The question involves two simultaneous transactions on the same database Process 1 Process 2 BEGIN BEGIN insert... insert...

Re: [sqlite] quick transaction question

2008-06-10 Thread Ken
Yes the BEGIN Transaction may get a BUSY/LOCKED error. If the BEGIN fails then do not commit, If you do commit you'll get an error indicating that the commit failed due to no active transaction Gregor Brandt <[EMAIL PROTECTED]> wrote: When doing transactional commits I do int error =

[sqlite] Accessibility dependend on command and folder

2008-06-10 Thread maximi
Hi im using php in a webapp to access a sqlite database. now since hours i'm confronted with a weird error: i can access my database just fine, as long as i use commands as simple as "select * from testtable where a='b'" as soon as there comes any 'distinct' or 'order by' or 'group by' into

Re: [sqlite] transaction locks w/ multiple DBs open/ATTACHed (reposted)

2008-06-10 Thread Dennis Cote
Robert Lehr wrote: > I am reposting this question b/c it received no reply previously and the > answers to my questions will significantly affect our application's > design. > > My current question focuses on SQLite's locking policy for transactions > on connections which have multiple DBs are

Re: [sqlite] (juste a test sorry)

2008-06-10 Thread toms
looks like it works again, sorry for the inconvenience :) toms a écrit : > (juste a test sorry) > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread John Elrick
Alex Katebi wrote: > Yes I need to do it as 8 byte buffer. Convert the endianess to the network > then back to host for 8 byte integer. > I think XML is great for command validation and CLI auto typing, help etc. > Besides parsing issue, XML can not handle binary data directly. > As John

Re: [sqlite] quick transaction question

2008-06-10 Thread Igor Tandetnik
Gregor Brandt <[EMAIL PROTECTED]> wrote: > When doing transactional commits I do > > int error = sqlite3_Exec( .., "BEGIN TRANSACTION;", ... ) // can > this ever return an error? No, as far as I know. It just sets a flag in an internal data structure associated with database connection. > int

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Hakki Dogusan
Hi, Alex Katebi wrote: > I am trying to implement remote procedure calls (RPC) for SQLite API to be > used in my application. > In particular sqlite3_column_double( ) returns a floating point double. > How can I write this double value into a TCP socket? > I have tried writing 8 bytes as integer

[sqlite] quick transaction question

2008-06-10 Thread Gregor Brandt
When doing transactional commits I do int error = sqlite3_Exec( .., "BEGIN TRANSACTION;", ... ) // can this ever return an error? int error = sqlite3_exect( ..., "some update command", ... ) if I get an error code, must I never do the "COMMIT;". what if I do? Thanks

Re: [sqlite] prepare peformances

2008-06-10 Thread Dennis Cote
I am forwarding this to the list in the hope that someone else will have a good idea since the OP, toms, is having trouble posting himself. Dennis Cote toms wrote: > ok here is the code I use for the statements: > > here is the SQL: > > "UPDATE Statistics_Players" > " SET " > "

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread John Stanton
Alex, the whole point of using XML is to avoid using binary data in an RPC situation and to tag the data and thus make extensions less traumatic. The radix change overhead is insignificant compared to the network cost and the bonus is complete freedom from endian dilemmas. The biggest

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Alex Katebi
D. Hipp, I have since identified and fixed my problem, thanks to our user group! A lot of the networking gear like IP routers use big-endian machines since this is the format used by the network protocol control messages. PowerPC is an example. Thanks, -Alex On Mon, Jun 9, 2008 at

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Alex Katebi
Arjen, Thanks! On Tue, Jun 10, 2008 at 1:39 PM, Arjen Markus <[EMAIL PROTECTED]> wrote: > > I am going to guess yes. > > > > On Mon, Jun 9, 2008 at 9:58 PM, Russell Leighton > > <[EMAIL PROTECTED]> > > wrote: > > > > >> > >> Aren' t there aligment and endian issues as well as potential floating

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Alex Katebi
Yes I need to do it as 8 byte buffer. Convert the endianess to the network then back to host for 8 byte integer. I think XML is great for command validation and CLI auto typing, help etc. Besides parsing issue, XML can not handle binary data directly. On Tue, Jun 10, 2008 at 12:31 PM, John

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Arjen Markus
> I am going to guess yes. > > On Mon, Jun 9, 2008 at 9:58 PM, Russell Leighton > <[EMAIL PROTECTED]> > wrote: > >> >> Aren' t there aligment and endian issues as well as potential floating >> point representations between platforms? >> As most computers nowadays use the IEEE standard to

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Alex Katebi
I am going to guess yes. On Mon, Jun 9, 2008 at 9:58 PM, Russell Leighton <[EMAIL PROTECTED]> wrote: > > On Jun 9, 2008, at 8:52 PM, Igor Tandetnik wrote: > > > "Alex Katebi" <[EMAIL PROTECTED]> > > wrote in message > > news:[EMAIL PROTECTED]<[EMAIL PROTECTED]> > >> I am trying to implement

[sqlite] Best Practices

2008-06-10 Thread A. H. Ongun
We have  an application requirement for the following: 1) Maintain an in memory database of real time data.  The main table mimics a Modbus register address scheme and once the table is created and records are inserted to create the table at startup, all writes are updates for the state

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Peter A. Friend
Alex Katebi wrote: > Peter, >I am using my own implementation. I found RPC and others too complicated > to use and it did not give me enough control on the transport layer. I need > my socket to be non-blocking and I am using epoll( ) which is very > efficient. > XDR is a separate

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Alex Katebi
Igor, You are right. The answer is to use 8 byte buffer and don't forget to account for the endianess. I had a bug in my code. On Mon, Jun 9, 2008 at 8:52 PM, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > "Alex Katebi" <[EMAIL PROTECTED]> > wrote in message > news:[EMAIL PROTECTED]<[EMAIL

Re: [sqlite] Writing double into a socket file

2008-06-10 Thread Alex Katebi
Peter, I am using my own implementation. I found RPC and others too complicated to use and it did not give me enough control on the transport layer. I need my socket to be non-blocking and I am using epoll( ) which is very efficient. Thanks! -Alex On Mon, Jun 9, 2008 at 10:53 PM, Peter A.

Re: [sqlite] Accessing SQLite from Javascript in Firefox

2008-06-10 Thread Shawn Wilsher
What you are looking for is the HTML 5 spec from the WHATWG. This contains a section on using SQL, but it is not yet implemented in Firefox (I think Opera is the only browser that supports it, and only when 9.5 comes out). Cheers, Shawn Wilsher Mozilla Developer On Tue, Jun 10, 2008 at 10:32

Re: [sqlite] Accessing SQLite from Javascript in Firefox

2008-06-10 Thread Ujval Mysore
Hi Igor, Can you please help me to understand the point - "Only script running in chrome (basically, in FireFox extensions) can access XPCOM components". Excuse for my ignorance. I was able to use SQLite in Internet Explorer using client side ADO. I am looking for a similar solution for

Re: [sqlite] Database locked error, while deleting

2008-06-10 Thread D. Richard Hipp
On Jun 10, 2008, at 10:18 AM, Shailesh Birari wrote: > Richard, > Just to go one step ahead, If there are independent connections, do > you > mean that there can exist multiple transactions at the same time? I > think not since the first transaction (write) will exclusively lock > the >

Re: [sqlite] Accessing SQLite from Javascript in Firefox

2008-06-10 Thread Ujval Mysore
Hi Lauri, Yes. I mean like in Google gears. But, I don't want to use Google gears api to do it. I want to access SQLite from plain javascript. Thanks, Ujval -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lauri Ojansivu Sent: Tuesday, June 10, 2008

Re: [sqlite] Database locked error, while deleting

2008-06-10 Thread Shailesh Birari
Richard, Just to go one step ahead, If there are independent connections, do you mean that there can exist multiple transactions at the same time? I think not since the first transaction (write) will exclusively lock the database and the second transaction will get a busy error. Correct me if I

Re: [sqlite] Problem with sqlite overall or not?

2008-06-10 Thread Jonas Sandman
Isn't this simply a vector problem? You have a vector where you store char pointers. The pointers returned from sqlite3_column_text will be destroyed when you step afaik. Try making it a vector instead. Then you will implicitly make copies of the text in your vector instead. /Jonas On Tue, Jun

Re: [sqlite] Accessing SQLite from Javascript in Firefox

2008-06-10 Thread Lauri Ojansivu
2008/6/10 Ujval Mysore <[EMAIL PROTECTED]>: > Hi, > > Has anyone tried accessing SQLite from Javascript in Firefox? > > I found an Sqlite helper library for Mozilla at > http://codesnippets.joyent.com/posts/show/1030 Hi, do you mean like in Google Gears? http://gears.google.com - Lauri

[sqlite] Problem with sqlite overall or not?

2008-06-10 Thread piotro
Hello. I really need help with this, because Im almost out of ideas here. Help please! sqldata is a vector< vector < char* > > row is a vector < char* > sqldata sql3wrapper::pobierzPodmiot(){ const char* tail; sqlite3_stmt* statement; std::string query = squery("SELECT * FROM

Re: [sqlite] Query Execution in SQLite

2008-06-10 Thread sqlite
Igor Tandetnik wrote: > > "sqlite" <[EMAIL PROTECTED]> wrote > in message news:[EMAIL PROTECTED] >> We are using SQLite for our application development which would be >> deployed in a pocket pc.Here we are using a inner join query which >> takes different time during different executions > >

Re: [sqlite] Database locked error, while deleting

2008-06-10 Thread Sabyasachi Ruj
Our PRAGMA cache_size = 4000. Is there any recommended way to calculate the cache size needed? On Tue, Jun 10, 2008 at 5:29 PM, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > "Sabyasachi Ruj" <[EMAIL PROTECTED]> > wrote in message > news:[EMAIL PROTECTED]<[EMAIL PROTECTED]> > > Now, I have two

Re: [sqlite] How to build an extension that gets autoloaded

2008-06-10 Thread Stephen Woodbridge
Hi Shane, Thank you for your response. I do need the rtree extension but I also have a need to some others and would like to know how to statically link in extensions anyway. -Steve Shane Harrelson wrote: > If you just need the rtree extension, I believe it will be included by > default in

Re: [sqlite] Query Execution in SQLite

2008-06-10 Thread Igor Tandetnik
"sqlite" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > We are using SQLite for our application development which would be > deployed in a pocket pc.Here we are using a inner join query which > takes different time during different executions What exactly does this mean? Are you

Re: [sqlite] Accessing SQLite from Javascript in Firefox

2008-06-10 Thread Igor Tandetnik
"Ujval Mysore" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Has anyone tried accessing SQLite from Javascript in Firefox? > > I found an Sqlite helper library for Mozilla at > http://codesnippets.joyent.com/posts/show/1030 . > > But when I try to execute the same, firefox throws

Re: [sqlite] Database locked error, while deleting

2008-06-10 Thread Sabyasachi Ruj
We are using two different connections to sqlite for these two different threads. So, we are not sharing the connection in SELECT and the DELETE thread. On Tue, Jun 10, 2008 at 5:28 PM, D. Richard Hipp <[EMAIL PROTECTED]> wrote: > > On Jun 10, 2008, at 7:36 AM, Sabyasachi Ruj wrote: > > > Hi, >

Re: [sqlite] Database locked error, while deleting

2008-06-10 Thread Igor Tandetnik
"Sabyasachi Ruj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Now, I have two threads:- > Thread1: Is deleting 7,00, 000 rows from the table. > Thread2: Is doing SELECT on the same table. > > Now the problem is sometimes the sqlite3_prepare for the SELECT query > is failing with

Re: [sqlite] Database locked error, while deleting

2008-06-10 Thread D. Richard Hipp
On Jun 10, 2008, at 7:50 AM, Alex Katebi wrote: > There can only be one prepare per table at a time. The first prepare > has to > be finalized before another one. Table is locked by the first > prepare until > finalized. > Actually, there is no limit on the number of prepared statements on

Re: [sqlite] Database locked error, while deleting

2008-06-10 Thread Alex Katebi
There can only be one prepare per table at a time. The first prepare has to be finalized before another one. Table is locked by the first prepare until finalized. On Tue, Jun 10, 2008 at 7:36 AM, Sabyasachi Ruj <[EMAIL PROTECTED]> wrote: > Hi, > > I have a very big table with around 40,00, 000

[sqlite] Database locked error, while deleting

2008-06-10 Thread Sabyasachi Ruj
Hi, I have a very big table with around 40,00, 000 rows. 4 columns. 220 MB. Now, I have two threads:- Thread1: Is deleting 7,00, 000 rows from the table. Thread2: Is doing SELECT on the same table. Now the problem is sometimes the sqlite3_prepare for the SELECT query is failing with SQLITE_BUSY

[sqlite] Accessing SQLite from Javascript in Firefox

2008-06-10 Thread Ujval Mysore
Hi, Has anyone tried accessing SQLite from Javascript in Firefox? I found an Sqlite helper library for Mozilla at http://codesnippets.joyent.com/posts/show/1030 . But when I try to execute the same, firefox throws the following exception uncaught exception: Permission denied to get property