Re: AW: [sqlite] Memory mapped db
On Thu, 28 Sep 2006 15:45:54 +0200, you wrote: Hi Michael >-Ursprüngliche Nachricht- >Von: Jay Sprenkle [mailto:[EMAIL PROTECTED] >Gesendet: Donnerstag, 28. September 2006 15:37 >An: sqlite-users@sqlite.org >Betreff: Re: [sqlite] Memory mapped db >That's not really the same. I would have to copy the db into ram after >opening it and since the db is too big to fit into the memory I would have >to recreate it dependend on my selects. >If sqlite maps the db into memory, the operating system manages the mapping, >sqlite "just" has to move it's view over the file. I'm working with some "small" SQLite databases, with less than 150.000 Records (Extractions of a bigger CS-DB). The records a stored in several Tables. One Table with 4000-5000 Records are bigger, the rest up to limit are smaller. I'm using SQlite to do some quickly jobs with the data on a local machine. I read and load the whole Result, opened by a SQL-Query, as a virtual table into a RAM's Vector-List. If this done, I can read Record by Record, forward, backward, skip any direction, alter, append new record, delete records. I can all do, what I want It seems to me, I do that, who you ask. But... I don't know, which developer-System you are using. I am working with VC++ .Net 2003. If that wrong to you, excuse the disturbance ;-) Is it OK, spend some time at my HP. Best Regards Thomas www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] The term "flat-file" as applied to sqlite
On Tue, 26 Sep 2006 11:20:09 -0700, you wrote: >Well, and English is a language used by humans to convey their >understandings to other humans :-). You can do technical >hairsplitting all you want, but the fact is that the term "flat file" >has a long history of being used to refer to text files with minimal >internal structure, no indexing, accessed with no or minimal locking, >no transactions, etc. Thats OK to me... no hairsplitting ;-) I think, that is really no problem, what is worth strenuous diskussion. Whether flat or not, this makes no important difference in this case. SQLite is a good engine... that is important to me :-) Best Regards Thomas www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] The term "flat-file" as applied to sqlite
On Mon, 25 Sep 2006 16:06:44 -0400, you wrote: Hello >I've noticed that more than one contributor to this list has referred to >sqlite as a "flat file database." I had always thought of a flat file as a >file composed of single table of records, with records defined either by >fixed-width allocations or by some sort of delimiter (e.g., comma-separated >files). What's about a flatfile? Is a SQLite-File really more than a Flatfile? Is a DBase-III-DB more than a Flatfile? What's about a car? Is a Ferrari really more than a car? Maybe some people think so. I think, a Ferrari is only a car too. And every File created by me with any Application and lying on the Disk on my PC is a singlefile, or a flatfile. Maybe some people can see the differences between a flatfile and a single-file. I cannot. Maybe a structured Textfile is a flatfile, if possibly readable as a tableview. But it is so only in humans view and humans understanding. A SQLite-File is equally structured, but only in SQlite's view and understanding. I distinguish this by way to access. A flatfile is accessible directly to me, a Client-Server-based DB only indirect. Only via a provider-connect to a server-instance, who handle my access to the DB, completely processed by another machine. Maybe I'm wrong. Maybe it is even philosophical problem. I have no problem, is a SQLite-File a Flatfile or not ;-) Best Regards Thomas www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Using SQLite on networked drive
On Mon, 25 Sep 2006 11:22:41 -0700 (PDT), you wrote: Hello >I have read articles and understood that it is not safe to access SQLite >database file on network drive. (on all windows). > >But what about Windows 2000 (Server) ??? i.e. If SQLite (3.3.4 or 3.3.6) >database file resides on disk drive of Windows 2000 Server, then is it safe >to access that SQLite database via network ? Now I'm totally confused.. ;-) You say, it is not safe to store DB on Network, but it is safe to store it on a Server. Where you see that this is different? It seems to me, that you mean, it is generally unsafe to store the DB in a Network-Drive. Is this thus? You can store a DB on your local Machine, or you can store a DB on Network-Drive, like as Windows Server. The SQLite-DB remains a Flatfile so or so, in contrast to a Client-Server-based System. If you store the DB on Network with possibly concurrency users, you have to set users rights with needed permits in the networks OS. And you have to avoid the logical collisions within your App, if more than one User try to write the same Record. I think, there a no serious problems in a dialog-based and interactive application in Network with some concurrent writing users and some more reading users. >Any thoughts...Any one's experience ? As additional compare, MS Access is a Flatfile-DB too. but it is only safe and stable until max 5 Users. That's my experience. I think, SQLite limits are much higher. *hmmm* If you create a real big application with many Users, maybe you think about again and anymore, which DB is the best ;-) HTH Thomas - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] How to maintain EXCLUSIVE access to database continuously ?
On Sun, 24 Sep 2006 04:41:55 -0700 (PDT), you wrote: >User (Client App) connects to middle-tier application-server and then user >may access any one company in normal or exclusive mode. Only >application-server communicates with database. If user wants exclusive >access, Application-Server needs to maintain that exclusive access to >database for that user. Hello I don't understand, how you get a real advantage, if you lock a Database (in daily processing) exclusive... I think, that isn't really necessary. But, if you want it nonetheless, then write and read a Lock-State-Table. I do it this way in my App. Every User do a Login in a specially Table and also a Lockout, if endet his work. If an exclusive Mode wanted by User, then write a adequate Info to the Lockstate-Table. Then check, that not another User has earlier rights. If this successful, the User can work in exlusive mode, is not, kick him out ;-) The real advantage by this way is, an Administrator is never blocked by a silly User, who has forgotten to logout and is gone to weekend at wednesday. My opinion is, never do a hard lock to a Database, except, it is done by the Database himself. Best Regards Thomas www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Difficulty with sqlite3.3.6 under VisualStudio.net
Hi Dixon Dixon Hutchinson wrote: > I am getting lots of errors of the sort: > > 'size_t' to 'int', possible loss of data > > I could just turn off the warnings, but that seems kind of wreckless. > The output from the compile is attached. Try this (But this is not really necessary.): #pragma warning( disable : 4267) Take a look at my HP. There is a working sample to create the Libraries. Best Regards Thomas -- www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Optimistic concurrency control
Hello On Tue, 19 Sep 2006 11:24:02 -0700 (PDT), you wrote: >Maybe I didn't make the question clear. I'm not talking about locking and >multiple writers. I'm talking about optimistic concurrency control in a >disconnected environment. > >IF anyone has changed the data since you last read it, the UPDATE affects no >rows and you know your update failed due to optimistic concurrency failure. I solved this problem by doing a logical Recordlocking. I connect to a SQL-Server DB always in optimistic Mode... and I open my SQLite-DB as if it was also (and any other DB too). The solution is a logical Recordlocking.That is what I do, before I try to alter a record. I check, if this attempt to write is permitted, to avoid that one User overwrite the changes from another User. Therefore I store (after I fetched the wanted Record) a Timestamp to a specific Table in a external specific DB (a specially Key-Collection). The TimeStamp contains: - the Users ID (Users Domain-ID) - the Workstations-ID (Network-Computername) - the Operating-Systems Process-ID - a initial Timestamp with Date and exhausted Seconds this Day - a Heartbeat-Timestamp (Always after 10 minutes every process updates his own locks) - a Class or Data-ID and - the Records ID (such as a Personnel number, not the RecID). It's needed, to lock also Records in several Childtables with same Personnel number, or so. If this full Timestamp successful written to the Recordlocking-Table, I perform a search to another Record with same tokens. If I found anyone and the founded initial Timestamp is earlier than my, only read is allowed to me. If my own Timestamp is the earliest, I can write and any other user only can read. If this "Edit-Class" is closed, or Programm is ended, the Lock becomes removed. If moved to another Record, the Timestamps and the Records-ID will be updated. If change to another class, the Class-ID will be updated in addition.. Sometimes I search dead or lost Locks and remove them. Dead or Lost Locks are Locks, which Heartbeat is older than 2 hours. In this way I lock also whole Tables or the full DB. That works really successful in a Network-Environment with up to 1500 concurrent users. The real advantage is in that way, that permitted Jobs (started by a Admin) can get and hold full rights. Best Regards Thomas www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: Re[4]: [sqlite] reg:blob data reading
On Mon, 18 Sep 2006 10:20:36 -0400, you wrote: >There's no right or wrong way. There is viewpoint from June 2006 with title: "To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem?" at http://research.microsoft.com/research/pubs/view.aspx?type=technical%20report=1089 Maybe it turns a light on... ;-) Best Regards Thomas www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] sqlite_blob
Hello sandhya wrote: > Hi, > Is there any way of reading Blob data for the given no.of bytes? > I mean is there any lseek kind of function call in sqlite to handle > reading BLOB data. http://www.sqlite.org/capi3ref.html says: "If the result is a BLOB then the sqlite3_column_bytes() routine returns the number of bytes in that BLOB." If you fetch the Blob into RAM, you can do with it with your given number of Bytes whatever you want I think too, if they are Big-Blobs, it is better to store only a Reference to a File. Best Regards Thomas -- www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Multiuser on LAN, how good/bad is it ?
Hi Martin Martin Alfredsson wrote: > Though I can interpret the the second statement as "on a single machine" > I'd like to hear about what your experience is with using it as multiuser > on a lan. > Does it crash due to network problem, does it work better with WinXP > than Win9x/2k/linux etc. I have performed some tests some time ago. At first I start 4 jobs competitively, each job insert 200 Records with a Single-Insert- Sql-Statement. Thats a little time-consuming. I got no problems. I could not forecast who becomes the topical one job, with the rights to write, but all Jobs finishd without errors. It changed even during running. At second I started 4 concurrency Transactions, each Job inserts 1 Records. Same Result! No Problems! Any Job finished without errors. Now I think, there is no Problems to use SQLIte as a Multiuser-DB, if it is a Dialog-Processing-Application. Note: From SQLite's viewpoint it is imho the same, if you store the DB on your local PC or on a public Fileserver. It stay as a Flatfile. Best Regards Thomas -- www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Re: Re: Re: Which API to use to get resultant of query
On Sun, 17 Sep 2006 13:03:23 +0530, you wrote: >Thank you very much for your suggestion. >I found very few samples in the siteBut hardly only one example is there >which explains abt handling BLOB data. >There is no documentation which explains about these samples .. >So for me all your support is very much required.please bear with me > >Thank you >Regards >Sandhya Hi Sandhya You can find a Sample-Testprogramm at http://www.thlu.de/db/rssqlitetest_vc.html, where you can see how to read and write Blobs in an easy way. It is a C++-Sample compiled with VC++ Net 2003. I solved this problem by using COleVariant. That is a MS-Type for interchange various types of Data to a Database, always going a similar way, with lowest possible expenditure. Best Regards Thomas www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Concurrency with writer and read-only processes
On Fri, 15 Sep 2006 17:29:13 -0400, you wrote: Hi Liam >I have a database that has one writer which runs once a day, and >potentially many readers running whenever someone wants some >information. I am trying to understand concurrency in sqlite3 so that I do a daily Job too in my programm. It seems to me, there are likewise rules. If you allow reading while another Process do a big writing, several reader possible get different results, while writer is not ready. Thats not a Sqlite-Problem, its the same to all other DB. The better way is, to lock the Table while it is be written and allow reading then, if this Jobs is ready. I don't mean a read-write-dialog-process in this case , but a big writer, ideally a especially and exclusive writer. Reading isn't a primary concurrency problem, much more writing is. I do my big writing while the system is generally locked to possible 1500 users. It's customized to a time, when Users are not present - at 03:00 o'clock in the morning. >I understand from lang_transaction that if the writer starts with >BEGIN IMMEDIATE >and ends with >END >then it will be possible for readers to read the database while the >writer is updating it: Is it ok to you, that user possibly get different or premature Query-Results? Best Regards Thomas www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: RE: [sqlite] Retrieving data
Hi Richard >> You don't need a Callback-Function in any case. Try it >> without > I'm confused. > How does the SELECT command return any data? In what > form would it give you this data back? There doesn't seem to > be a pointer to pass by reference and no out variables. The Prepare-Command with it's given SQL-Statement doesn't return Data. *Imho* it prepares only the Database-Engine. I fetch the Data after I "prepared" the Database with "_sqlite3_step()". I say it again. Spend a little time to my samples. Best Regards Thomas -- www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Retrieving data
Am 14.09.2006 um 02:11 Uhr haben Sie geschrieben: > I'm using sqlite in VC++ 2005. > When I started this I knew nothing about sqlite or indeed SQL at all so its > been tough going trying to work out how this all works. I started so too ;-) > I tried: > sqlite3_exec(AccDataBase,"SELECT Name,Address FROM Accounts WHERE MemberNo = > 2;",Callback(cError,10,,),test,); You don't need a Callback-Function in any case. Try it without I performed two little Samples on my HP. Take a look. > Now I don't fully understand how the callback part works so I just made the It's coming soon, because you work with it Best regards, Thomas -- www.thlu.de - To unsubscribe, send email to [EMAIL PROTECTED] -