Re: [sqlite] How to sort not binary?

2007-06-24 Thread drh
Yves Goergen <[EMAIL PROTECTED]> wrote:
> On 22.06.2007 17:48 CE(S)T, Yves Goergen wrote:
> > Match m1 = Regex.Match(param1, "^([0-9]+)");
> > if (m1.Success)
> > {
> >   Match m2 = Regex.Match(param2, "^([0-9]+)");
> >   if (m2.Success)
> >   {
> > int cmpNum = int.Parse(m1.Groups[1].Value) -
> >   int.Parse(m2.Groups[1].Value);
> > if (cmpNum != 0) return cmpNum;
> >   }
> > }
> > return String.Compare(param1, param2, true);
> 
> Oh, well, I just realised that this will only sort numbers "naturally"
> at the beginning of strings, but not in the middle or at the end. It
> will be a bit more complex to do that. Maybe I find a sort/compare
> algorithm for it. But at least I know now that it's easy to use. :)
> 

Check out the "sortStrCmp()" function in older versions of
SQLite version 2 in the util.c source file.  See, for example,

   http://www.sqlite.org/cvstrac/fileview?f=sqlite/src/util.c=1.42

I think the sortStrCmp() function does what you are after.
--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Tomcat crashes with SQLite

2007-06-24 Thread drh
"Frederic de la Goublaye" <[EMAIL PROTECTED]> wrote:
> My server crashed again.
> 
> I recompiled sqlite3-3-5 with this configure option
> --enable-threadsafe =yes
> 
> But I read that sqlite has somebug under Unix with the management of the
> THREADS.
> 

Some version so of Linux have a bug.  Upgrade to linux
kernel series 2.6 and you should be OK.
--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Tomcat crashes with SQLite

2007-06-24 Thread Frederic de la Goublaye

My server crashed again.

I recompiled sqlite3-3-5 with this configure option
--enable-threadsafe =yes

But I read that sqlite has somebug under Unix with the management of the
THREADS.

Can it work with my Java code ?

Thanks for attention.
Frederic


An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 10 occurred at PC=0x712C5D06
Function=sqlite3VdbeExec+0x24D2
Library=/usr/local/lib/libsqlite3.so.8

On 6/24/07, Frederic de la Goublaye <[EMAIL PROTECTED]> wrote:


Thanks for your answer.

I just recompiled sqlite with *DTHREADSAFE=1*
http://www.sqlite.org/cvstrac/wiki?p=MultiThreading

I will publish the results.

Cheers
Frédéric

On 6/22/07, Russell Leighton <[EMAIL PROTECTED]> wrote:
>
>
> If you did not compile sqlite as multi-threaded this is exactly what
> would happen.
>
> On Jun 22, 2007, at 9:06 PM, Frederic de la Goublaye wrote:
>
> > Hi I just tried this driver:
> > http://www.zentus.com/sqlitejdbc/
> >
> > The result is ten times slower or even more.
> > Maybe I am wrong using this new driver.
> >
> > So for the moment I am still using this one:
> > http://www.ch-werner.de/javasqlite/
> >
> > BUT I HAVE STILL THE CRASH TROUBLES:
> >
> > An unexpected exception has been detected in native code outside the
> > VM.
> > Unexpected Signal : 11 occurred at PC=0x34D8493F
> > Function=sqlite3VdbeExec+0x10B
> > Library=/usr/local/lib/libsqlite3.so.8
> >
> > ANY IDEAR ???
> >
> > Thanks for your attention.
> >
> > Cheers
> > Frederic
> >
> >
> >
> >
> >
> > On 6/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > wrote:
> >>
> >>
> >> > My project is working with Tomcat, SQLite and javasqlite.
> >> > http://www.ch-werner.de/javasqlite/
> >> >
> >> > http://www.ysalaya.org
> >> >
> >> > Since a few weeks Tomcat server crashes very often: error 505
> >> > and I need to restart it manually. It is installed on FreeBSD 5.4.
> >> >
> >> > Please see the Tomcat log file bellow.
> >> > It seems to be an error in SQLite outsite the Java Virtual Machine.
> >> >
> >> > ANY IDEAR ?
> >>
> >> I see 2 possible explanations:
> >> 1. You use the same connection in different threads at the same time.
> >> 2. There are bugs in JDBC driver. If this is the case, try driver
> from
> >> http://www.zentus.com/sqlitejdbc. It for sure has bugs, but may be
> >> different and you won't even notice them. You may use pure java
> >> version -
> >> it will be probably slower than JNI based, but should never crash VM.
>
> >>
> >>
> >>
> >>
> --
> >> Wicie, rozumicie
> >> Zobacz >>> http://link.interia.pl/f1a74
> >>
> >>
> >>
> >>
> --
> >> ---
> >> To unsubscribe, send email to [EMAIL PROTECTED]
> >>
> >>
> --
> >> ---
> >>
> >>
>
>
> -
>
> To unsubscribe, send email to [EMAIL PROTECTED]
>
> -
>
>



RE: [sqlite] Introducing... ManagedSQLite

2007-06-24 Thread WHITE, DANIEL
Hi Sam!

1. I don't have any samples.  If you would like to write some that would
be great!  Rob's article at Code Project
 Has some of his
samples.  Most of the functions are still the same function-wise as his.
I have cleaned up the naming, added managed exceptions, and added
Unicode support.

2. I don't think so.  This is a small part of a bigger project I am
working on so I don't have the time to focus much on it.  Anysway, its
not feature complete and it has the SQLite code in it -- NATIVELY -- no
changes.

Best of luck!

Daniel A. White 
{ Kent State University: Computer Science major }
{ JMC TechHelp: Taylor Hall, server techie }
{ E-mail: [EMAIL PROTECTED] }
{ Colossians 3:17 }

-Original Message-
From: sqlite [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 24, 2007 2:33 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Introducing... ManagedSQLite

Hello. 

Thanks for doing this.  I have two questions: 

1.  is there sample code that uses the library in your svn?  [i just
scanned quickly, but there didn't seem to be] 

2.  do you have plans to port the test suite so they can be run against
this library? 

Thanks! 

  - sam - 

WHITE, DANIEL writes: 

> Howdy all! 
> 
> I am just writing tonight to let you know that a project of mine has 
> opened up to being open source -- ManagedSQLite.  It is a light 
> wrapper around SQLite 3.4.0 that was originally written by Rob Groves.

> I have added support for Unicode to his wrapper, then added my Managed

> (.NET) port to the mix.  One DLL file unlike others out there.  
> Supports FTS1 and FTS2 out of the box!!!
> 
> I am looking for help with this little project.  I think we could 
> eventually make an entire ADO.NET wrapper with this thing.  Thanks.
> 
> http://code.google.com/p/managed-sqlite/
> 
> Thanks for reading. 
> 
> Daniel A. White
> { Kent State University: Computer Science major } { JMC TechHelp: 
> Taylor Hall, server techie } { E-mail: [EMAIL PROTECTED] } { 
> Colossians 3:17 }
> 


-
To unsubscribe, send email to [EMAIL PROTECTED]

-


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Tomcat crashes with SQLite

2007-06-24 Thread Frederic de la Goublaye

Thanks for your answer.

I just recompiled sqlite with *DTHREADSAFE=1*
http://www.sqlite.org/cvstrac/wiki?p=MultiThreading

I will publish the results.

Cheers
Frédéric

On 6/22/07, Russell Leighton <[EMAIL PROTECTED]> wrote:



If you did not compile sqlite as multi-threaded this is exactly what
would happen.

On Jun 22, 2007, at 9:06 PM, Frederic de la Goublaye wrote:

> Hi I just tried this driver:
> http://www.zentus.com/sqlitejdbc/
>
> The result is ten times slower or even more.
> Maybe I am wrong using this new driver.
>
> So for the moment I am still using this one:
> http://www.ch-werner.de/javasqlite/
>
> BUT I HAVE STILL THE CRASH TROUBLES:
>
> An unexpected exception has been detected in native code outside the
> VM.
> Unexpected Signal : 11 occurred at PC=0x34D8493F
> Function=sqlite3VdbeExec+0x10B
> Library=/usr/local/lib/libsqlite3.so.8
>
> ANY IDEAR ???
>
> Thanks for your attention.
>
> Cheers
> Frederic
>
>
>
>
>
> On 6/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
>>
>>
>> > My project is working with Tomcat, SQLite and javasqlite.
>> > http://www.ch-werner.de/javasqlite/
>> >
>> > http://www.ysalaya.org
>> >
>> > Since a few weeks Tomcat server crashes very often: error 505
>> > and I need to restart it manually. It is installed on FreeBSD 5.4.
>> >
>> > Please see the Tomcat log file bellow.
>> > It seems to be an error in SQLite outsite the Java Virtual Machine.
>> >
>> > ANY IDEAR ?
>>
>> I see 2 possible explanations:
>> 1. You use the same connection in different threads at the same time.
>> 2. There are bugs in JDBC driver. If this is the case, try driver from
>> http://www.zentus.com/sqlitejdbc. It for sure has bugs, but may be
>> different and you won't even notice them. You may use pure java
>> version -
>> it will be probably slower than JNI based, but should never crash VM.
>>
>>
>>
>> --
>> Wicie, rozumicie
>> Zobacz >>> http://link.interia.pl/f1a74
>>
>>
>>
>> --
>> ---
>> To unsubscribe, send email to [EMAIL PROTECTED]
>>
>> --
>> ---
>>
>>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] Introducing... ManagedSQLite

2007-06-24 Thread sqlite
Hello. 

Thanks for doing this.  I have two questions: 

1.  is there sample code that uses the library in your svn?  [i just scanned 
quickly, but there didn't seem to be] 

2.  do you have plans to port the test suite so they can be run against this 
library? 

Thanks! 

 - sam - 

WHITE, DANIEL writes: 

Howdy all! 


I am just writing tonight to let you know that a project of mine has
opened up to being open source -- ManagedSQLite.  It is a light wrapper
around SQLite 3.4.0 that was originally written by Rob Groves.  I have
added support for Unicode to his wrapper, then added my Managed (.NET)
port to the mix.  One DLL file unlike others out there.  Supports FTS1
and FTS2 out of the box!!! 


I am looking for help with this little project.  I think we could
eventually make an entire ADO.NET wrapper with this thing.  Thanks. 

http://code.google.com/p/managed-sqlite/ 

Thanks for reading. 

Daniel A. White 
{ Kent State University: Computer Science major }

{ JMC TechHelp: Taylor Hall, server techie }
{ E-mail: [EMAIL PROTECTED] }
{ Colossians 3:17 } 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] Introducing... ManagedSQLite

2007-06-24 Thread Robert Simpson
> -Original Message-
> From: WHITE, DANIEL [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, June 23, 2007 7:29 PM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] Introducing... ManagedSQLite
> 
> Howdy all!
> 
> I am just writing tonight to let you know that a project of mine has
> opened up to being open source -- ManagedSQLite.  It is a 
> light wrapper
> around SQLite 3.4.0 that was originally written by Rob Groves.  I have
> added support for Unicode to his wrapper, then added my Managed (.NET)
> port to the mix.  One DLL file unlike others out there.  Supports FTS1
> and FTS2 out of the box!!!
> 
> I am looking for help with this little project.  I think we could
> eventually make an entire ADO.NET wrapper with this thing.  Thanks.
> 
> http://code.google.com/p/managed-sqlite/


Actually I've already gone and written an ADO.NET 2.0 wrapper for SQLite
more than 2 years ago.  It's even a single-file binary :)

http://sqlite.phxsoftware.com

Robert



-
To unsubscribe, send email to [EMAIL PROTECTED]
-