[sqlite] sqlite3_open() fails on WinCE due to utf8ToUnicode / unicodeToUtf8

2007-06-01 Thread [EMAIL PROTECTED]
Hello It looks like there's a problem on WinCE operating system with the utf8ToUnicode() / unicodeToUtf8() conversion functions. No database can be opened by sqlite3_open() because thehes functions fail. Please have a look what happens there (location: os_win.c :) /* ** Convert a UTF-8 string

Re: [sqlite] sqlite3_open() fails on WinCE due to utf8ToUnicode / unicodeToUtf8

2007-06-01 Thread Nuno Lucas
On 6/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello It looks like there's a problem on WinCE operating system with the utf8ToUnicode() / unicodeToUtf8() conversion functions. No database can be opened by sqlite3_open() because thehes functions fail. Please have a look what happens

Re: [sqlite] file structure issue

2007-06-01 Thread weiyang wang
Nuno and Vivien thanks for your replies. i will try that. wang On 5/23/07, Nuno Lucas <[EMAIL PROTECTED]> wrote: On 5/23/07, weiyang wang <[EMAIL PROTECTED]> wrote: > does anyone know how can i get the source codes with the early file > structure? (65 seperate files)? thanks in advance.

[sqlite] Concurrency

2007-06-01 Thread b00mer
Hi, I am having a scenario where I have one reader/writer and many writer threads. All writers are pretty basic (single INSERT INTO; some sort of a logging info what a thread has done). I believe I will receive many BUSY return codes and I don't like these spinlock-like retries. The problem I am

RE: [sqlite] Concurrency

2007-06-01 Thread b00mer
Tom, > > I don't want to use > > other database, because I think Sqlite is great for an > > embedded system that I > > am using. > >I think that your own questions about concurrency prove this > incorrect. If you need high concurrency and you don't like retries, > SQLite is not the database

Re: [sqlite] Concurrency

2007-06-01 Thread John Stanton
We find that synchronizing access to database writes using a mutex works well. You could think of implementing read and write locks using the thread primitives and achieve a better result. If you do poll to resolve busy checks a spinlock is certainly a bad idea. When we use that approach we

RE: [sqlite] Concurrency

2007-06-01 Thread Tom Briggs
> I don't want to use > other database, because I think Sqlite is great for an > embedded system that I > am using. I think that your own questions about concurrency prove this incorrect. If you need high concurrency and you don't like retries, SQLite is not the database for you. -T

AW: Re: [sqlite] sqlite3_open() fails on WinCE due to utf8ToUnicode / unicodeToU

2007-06-01 Thread [EMAIL PROTECTED]
Hello Yes, I can rebuild the image, but i didn't find any UTF-8 code page. But it really looks like this code page is not installed, because I tried GetCPInfo(CP_ACP, ) and it failed with ERROR_INVALID_PARAMETER. Can you tell me where I can enable UTF-8 support. (hope this is not to

Re: [sqlite] Concurrency

2007-06-01 Thread John Stanton
Tom Briggs wrote: I don't want to use other database, because I think Sqlite is great for an embedded system that I am using. I think that your own questions about concurrency prove this incorrect. If you need high concurrency and you don't like retries, SQLite is not the database

Re: Re: [sqlite] sqlite3_open() fails on WinCE due to utf8ToUnicode / unicodeToU

2007-06-01 Thread Nuno Lucas
On 6/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Yes, I can rebuild the image, but i didn't find any UTF-8 code page. But it really looks like this code page is not installed, because I tried GetCPInfo(CP_ACP, ) and it failed with ERROR_INVALID_PARAMETER. Can you tell me where I can

RE: [sqlite] Concurrency

2007-06-01 Thread Samuel R. Neff
If option (b), using a single thread for writing and a multi-threaded write queue works in your situation, then that would probably provide best concurrency and performance. The only downside to this is the delayed writes mean you don't as easily get feedback to the original writer if a write

RE: [sqlite] Concurrency

2007-06-01 Thread Tom Briggs
I have no suggestions (I'm not an embedded systems guy), but your initial comment implied that there were other options. If there aren't then your original statement is invalid and there's nothing to discuss. :) -T > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL

RE: [sqlite] Concurrency

2007-06-01 Thread Tom Briggs
> If you require ACID type data integrity and have a single > disk there is > no such thing as a "high concurrency database". They all Then don't blame me if he's asking the wrong questions. :) -T - To

Re: [sqlite] Concurrency

2007-06-01 Thread Ian Frosst
On the topic of a more efficient busy handler, one approach I considered was to implement an event which was signalled when a database unlock occurred. That way, the busy handler could just wait on the event (which is an efficient wait state), and be guaranteed of a wake up when the lock is

Re: [sqlite] Concurrency

2007-06-01 Thread John Stanton
Samuel R. Neff wrote: If option (b), using a single thread for writing and a multi-threaded write queue works in your situation, then that would probably provide best concurrency and performance. The only downside to this is the delayed writes mean you don't as easily get feedback to the

RE: [sqlite] Concurrency

2007-06-01 Thread KKH
// wrapper for sqlite3_prepare_v2 which retries creating statements if the db returns SQLITE_BUSY or SQLITE_LOCKED int sql_prepare(sqlite3 *db, const char *sql, sqlite3_stmt **ppStmt, int wait) { #ifdef SQL_DEBUG printf(sql); printf("\n"); fflush(stdout); #endif int

Re: [sqlite] Concurrency

2007-06-01 Thread Israel Figueroa
What if the database is locked by another application, or by another box? The driver should poll untill it get an "idle database" and then thow an event... and then, we're polling again. I'm coding some similar to the original post... I'm not that good with threads yet, but I did foresee that

Re: [sqlite] Concurrency

2007-06-01 Thread John Stanton
With other applications you can use semaphores for synchronization and achieve minimal latency and a low overhead. If you have networked files you are dependent upon the file locking and on the effectiveness of the cross network file locking. This does not necessarily work as expected and in

[sqlite] Sqlite 3 Crash on OSX

2007-06-01 Thread Mark Gilbert
Folks. My app just crashed in the field randomly after some time running fine. Thread 12 Crashed: 0 libsqlite3.0.dylib 0x9406e587 sqlite3pager_get + 390 1 libsqlite3.0.dylib 0x94054275 sqlite3BtreeCopyFile + 381 2 libsqlite3.0.dylib

Re: [sqlite] Concurrency

2007-06-01 Thread Doug Currie
On Friday, June 01, 2007 Ian Frosst wrote: > On the topic of a more efficient busy handler, one approach I considered was > to implement an event which was signalled when a database unlock occurred. > That way, the busy handler could just wait on the event (which is an > efficient wait state),

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
Got this nearly worked out now, but somehow I can't get the nested case when syntax right: SELECT case when date('2006-10-14', '+' || (strftime('%Y', 'now') - strftime('%Y', '2006-10-14')) || ' years') <= date('now') then case when strftime('%d', 'now') > strftime('%d', '2006-10-14') then

Re: [sqlite] Concurrency

2007-06-01 Thread Ian Frosst
For Windows, this is not the case with Automatic Reset events. The system guarantees that only one thread waiting on the event is woken up (it keeps a queue): the others happily keep sleeping until the next setting of the event. On 6/1/07, Doug Currie <[EMAIL PROTECTED]> wrote: On Friday,

Re: [sqlite] Concurrency

2007-06-01 Thread Ken
[EMAIL PROTECTED] wrote: Hi, I am having a scenario where I have one reader/writer and many writer threads. All writers are pretty basic (single INSERT INTO; some sort of a logging info what a thread has done). I believe I will receive many BUSY return codes and I don't like these

Re: [sqlite] Concurrency

2007-06-01 Thread Doug Currie
On Friday, June 01, 2007 Ian Frosst wrote: > For Windows, this is not the case with Automatic Reset events. The system > guarantees that only one thread waiting on the event is woken up (it keeps a > queue): the others happily keep sleeping until the next setting of the > event. That may work

RE: [sqlite] Concurrency

2007-06-01 Thread Samuel R. Neff
Nice analogy, but in the case the cat really does have 9 lives (or many more) 'cause with SQLITE_BUSY you can just retry and while retrying is a performance penalty in my experience SQLITE_BUSY is a very rare occurrence. All I'm saying is don't fix a perceived problem until you've tested to be

Re: [sqlite] Concurrency

2007-06-01 Thread Eduardo Morras
At 11:17 01/06/2007, you wrote: >Hi, > >I am having a scenario where I have one reader/writer and many writer threads. >All writers are pretty basic (single INSERT INTO; some sort of a logging info >what a thread has done). > >I believe I will receive many BUSY return codes and I don't like these

Re: [sqlite] Re: CAST

2007-06-01 Thread BardzoTajneKonto
> Sqlite lets us advance our storage > capabilities into a more flexible world. Sure, but it's not allways a good thing. Usually one column stores related data. Related data mostly have the same type. Entering a value of different type is an error which is silently ignored. Allowing different

Re: [sqlite] Concurrency

2007-06-01 Thread Marco Bambini
Why you said less than 29? --- Marco Bambini http://www.sqlabs.net http://www.sqlabs.net/blog/ http://www.sqlabs.net/realsqlserver/ On Jun 1, 2007, at 6:56 PM, Eduardo Morras wrote: At 11:17 01/06/2007, you wrote: Hi, I am having a scenario where I have one reader/writer and many writer

[sqlite] Does Attach improve Concurrency ?

2007-06-01 Thread Samuel R. Neff
When you have a connection with multiple attached databases and the connection acquires an exclusive lock, does it always lock all attached databases or does it keep track of which databases require the lock? Does using separate databases and attaching them improve concurrency (by providing

Re: [sqlite] Concurrency

2007-06-01 Thread Eduardo Morras
At 19:24 01/06/2007, you wrote: >Why you said less than 29? SQLite has a soft limit of 10 databases and a hard limit of 32, you can change it at compile time. If i remember well, sqlite uses two databases for metadata/schema, so you get a max of 30 databases, you need another one as master db,

Re: [sqlite] Age calculation on literal

2007-06-01 Thread Dennis Cote
On 6/1/07, RB Smissaert <[EMAIL PROTECTED]> wrote: Got this nearly worked out now, but somehow I can't get the nested case when syntax right: SELECT case when date('2006-10-14', '+' || (strftime('%Y', 'now') - strftime('%Y', '2006-10-14')) || ' years') <= date('now') then case when

Re: [sqlite] Concurrency

2007-06-01 Thread Will Leshner
On 6/1/07, Eduardo Morras <[EMAIL PROTECTED]> wrote: If i remember well, sqlite uses two databases for metadata/schema Databases or tables? Could you be thinking of the sqlite_master table? - To unsubscribe, send

Re: [sqlite] Does Attach improve Concurrency ?

2007-06-01 Thread Eduardo Morras
At 19:32 01/06/2007, you wrote: >When you have a connection with multiple attached databases and the >connection acquires an exclusive lock, does it always lock all attached >databases or does it keep track of which databases require the lock? Does >using separate databases and attaching them

Re: [sqlite] Concurrency

2007-06-01 Thread Eduardo Morras
At 20:58 01/06/2007, you wrote: >On 6/1/07, Eduardo Morras <[EMAIL PROTECTED]> wrote: > >>If i remember well, sqlite uses two databases for metadata/schema > >Databases or tables? Could you be thinking of the sqlite_master table? You're right 1 db and 2 tables. Yes i'm thinking on

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
Yes, that looks better and thanks for that. Still get the same error though. I will keep fiddling with it. RBS -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: 01 June 2007 19:53 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Age calculation on literal On

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
Got this now, after correcting the brackets: SELECT case when date('2006-10-14', '+' || (strftime('%Y', 'now') - strftime('%Y', '2006- 10-14')) || ' years') <= date('now') then case when strftime('%d', 'now') > strftime('%d', '2006-10-14') then ((strftime('%Y', 'now')

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
Got the syntax right, but not the logic. I believe this (VB) function will now get the right SQL to get the age in months: Function ISO8601Date2AgeInMonths(strField As String, _ Optional strAlias As String) As String Dim strAS As String If Len(strAlias) > 0

[sqlite] Re: Changing Schema On The Fly

2007-06-01 Thread Mitchell Vincent
I guess this isn't possible after all? On 5/31/07, Mitchell Vincent <[EMAIL PROTECTED]> wrote: I have a set of databases that contain a date type called "timestamp". I need to make those "integer" so they come through the ODBC driver the right way. Is there any way to change all of that through

Re: [sqlite] Re: Changing Schema On The Fly

2007-06-01 Thread Joe Wilson
--- Mitchell Vincent <[EMAIL PROTECTED]> wrote: > I guess this isn't possible after all? Get the SQLite ODBC driver source code and alter it to do whatever you like when the type "timestamp" column comes up. > On 5/31/07, Mitchell Vincent <[EMAIL PROTECTED]> wrote: > > I have a set of databases