Re: [sqlite] Finding Missing Table Rows

2008-05-15 Thread Darren Duncan
Gerry Snyder wrote:
> Darren Duncan wrote:
>> Clue stick coming up.  There's a much simpler solution.
>>
>> You should be using relational difference instead, the MINUS keyword, whose 
>> syntax is the same as UNION but for the keyword.
>>   
> I think maybe you mean EXCEPT, not MINUS.
> 
> Gerry

Yes, different spelling but same feature. -- Darren Duncan
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Finding Missing Table Rows

2008-05-15 Thread Gerry Snyder
Darren Duncan wrote:
> Clue stick coming up.  There's a much simpler solution.
>
> You should be using relational difference instead, the MINUS keyword, whose 
> syntax is the same as UNION but for the keyword.
>   
I think maybe you mean EXCEPT, not MINUS.

Gerry

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


Re: [sqlite] Finding Missing Table Rows

2008-05-15 Thread Darren Duncan
Rich Shepard wrote:
>I have two tables that should have the same number of rows, but one is 2
> rows short and I'm trying to identify which rows exists in the first table
> (Fuzzyset) that's missing from the second table (Rules).
> 
>I thought that a right outer join might work with "NOT EXISTS" in the

> 
>I'm sure that I've seen (and probably used) this type of query before so
> I've no idea why the proper syntax is eluding me.
> 
>A clue stick will be very helpful.

Clue stick coming up.  There's a much simpler solution.

You should be using relational difference instead, the MINUS keyword, whose 
syntax is the same as UNION but for the keyword.

Try this:

(select f.parent as c1, f.subcomp as c2, f.comp as c3
from Fuzzyset as f)
minus
(select r.var_name as c1, r.subcomp_name as c2, r.comp_name as c3
from Rules as r)

The result should have 3 columns and 2 rows.

Rename c1,2,3 to taste, or adjust any other details as necessary.

If you wanted more info returned than that, then use the above in a 
subquery which is joined with Fuzzyset.

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


[sqlite] Finding Missing Table Rows

2008-05-15 Thread Rich Shepard
   I'm embarrassed to have to ask for help on this query, but I am not
finding the solution in my local references (Celko's "SQL for Smarties, 3rd
ed", van der Lans' "Introduction to SQL, 4th ed") or by searching for
Google.

   I have two tables that should have the same number of rows, but one is 2
rows short and I'm trying to identify which rows exists in the first table
(Fuzzyset) that's missing from the second table (Rules).

   I thought that a right outer join might work with "NOT EXISTS" in the
WHERE clause, but I'm getting syntax errors. There are 3 attributes common
to the two tables: f.parent=Rules.var_name, f.subcomp=Rules.subcomp_name,
f.comp=Rules.comp_name.

   What I tried, among other attempts, was:

select name, parent, subcomp, comp from Fuzzyset, Rules where not exists
(Fuzzyset.parent=Rules.var_name and Fuzzyset.subcomp=Rules.subcomp_name and
Fuzzyset.comp=Rules.comp_name);

but this throws a syntax error.

   I'm sure that I've seen (and probably used) this type of query before so
I've no idea why the proper syntax is eluding me.

   A clue stick will be very helpful.

Thanks,

Rich

-- 
Richard B. Shepard, Ph.D.   |  IntegrityCredibility
Applied Ecosystem Services, Inc.|Innovation
 Voice: 503-667-4517  Fax: 503-667-8863
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Locking causing exponentially degraded peformance with multiple processes

2008-05-15 Thread Samuel Neff
We're running into a lot of very slow queries and db locks when running with
multiple processes accessing the same database.  As a test we created a
small application that has only two threads and a small single table
database.

RunRead reads all data from the one table (100 records).

RunWrite updates all the records in the table (no add/delete, just update).

When run by itself with just one process, each read/write concurrent
operation runs in 500ms.  It's synchronized to start both read/write at the
same time and then wait for each to finish before starting the next test,
and then loops.  It's pretty consistent around 500ms.

When I run the same app multiple times (multiple concurrent processes), the
operations degrade very quickly.  It starts off taking 1-5 seconds for each
read/write concurrent operation but after a few minutes it often takes 20-30
seconds for a a single operation and sometimes 45 seconds.

The transactions are all BEGIN IMMEDIATE and the noticable time taken is
during COMMIT.  The reads are not run within a transaction.

I'm using sqlite 3.5.9 in SQLite.NET.  Full C# test code follows.

Is there something I'm doing wrong that is causing this lock contention?  Is
there anything I can do to improve performance in a multi-process
application?

Thanks,

Sam




using System;
using System.Data;
using System.Data.SQLite;
using System.Diagnostics;
using System.IO;
using System.Threading;

namespace test
{
  public class DbLockTest
  {
private static readonly Random _random = new Random();

private readonly ManualResetEvent _start = new ManualResetEvent(false);
private readonly ManualResetEvent _readDone = new
ManualResetEvent(false);
private readonly ManualResetEvent _writeDone = new
ManualResetEvent(false);
private Stopwatch _timer;

public static void Run()
{
  if (!File.Exists("DbLockTest.dat"))
  {
using (SQLiteConnection cnn = CreateConnection())
{
  using (SQLiteTransaction trans = cnn.BeginTransaction())
  {
using (SQLiteCommand cmd = cnn.CreateCommand())
{
  cmd.CommandText = "CREATE TABLE Data (id INTEGER PRIMARY KEY
AUTOINCREMENT, text TEXT);";
  cmd.ExecuteNonQuery();
}

for (int i = 0; i < 100; i++)
{
  using (SQLiteCommand cmd = cnn.CreateCommand())
  {
cmd.CommandText = "INSERT INTO Data (text) VALUES (@text);";
cmd.Parameters.AddWithValue("@text", new string((char)(65 +
i), i * 100));
cmd.ExecuteNonQuery();
  }
}
trans.Commit();
  }
}
  }

  for (int i = 0; i < 50; i++)
  {
new DbLockTest().RunImpl();
Thread.Sleep(1);
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
  }

  Console.WriteLine("Done.  Hit any key.");
  Console.ReadKey();
}

public void RunImpl()
{
  _timer = Stopwatch.StartNew();

  Console.WriteLine("{0:0,000} - MAIN  - Queuing threads",
_timer.ElapsedMilliseconds);

  ThreadPool.QueueUserWorkItem(RunRead, _random.Next(15));
  ThreadPool.QueueUserWorkItem(RunWrite, _random.Next(15));

  Thread.Sleep(100);

  Console.WriteLine("{0:0,000} - MAIN  - Signaling threads",
_timer.ElapsedMilliseconds);

  _start.Set();

  _readDone.WaitOne();
  Console.WriteLine("{0:0,000} - MAIN  - Read done received",
_timer.ElapsedMilliseconds);
  _writeDone.WaitOne();
  Console.WriteLine("{0:0,000} - MAIN  - Write done received",
_timer.ElapsedMilliseconds);
}

private void RunRead(object state)
{
  try
  {
Console.WriteLine("{0:0,000} - READ  - Waiting for signal",
_timer.ElapsedMilliseconds);

_start.WaitOne();
/*
int wait = (int) state;
Console.WriteLine("{0:0,000} - READ  - Sleeping {1} ms",
_timer.ElapsedMilliseconds, wait);
Thread.Sleep(wait);
*/
IDataReader reader;

Console.WriteLine("{0:0,000} - READ  - Opening connection",
_timer.ElapsedMilliseconds);

SQLiteConnection cnn = CreateConnection();
using(SQLiteCommand cmd = cnn.CreateCommand())
{
  cmd.CommandText = "SELECT * FROM Data";
  Console.WriteLine("{0:0,000} - READ  - Getting reader",
_timer.ElapsedMilliseconds);
  reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
}

Console.WriteLine("{0:0,000} - READ  - Looping through data",
_timer.ElapsedMilliseconds);
int i = 0;
while (reader.Read())
{
  if (i++ % 10 == 0)
  {
Thread.Sleep(1);
  }
}

Console.WriteLine("{0:0,000} - READ  - Closing reader (and thus
connection)", _timer.ElapsedMilliseconds);
reader.Close();

Console.WriteLine("{0:0,000} - READ  - Signaling done",
_timer.ElapsedMilliseconds);
  }
  

Re: [sqlite] SQLite remote management tools?

2008-05-15 Thread Richard Klein
Federico Granata wrote:
>> I was hoping there might be a client/server management tool out there.
>> I would need the source code, since the server part would need to be
>> ported to my embedded device.
>>
> Maybe you haven't yet read this http://www.sqlite.org/serverless.html
> There isn't a sqlite server so you can't have a sqlite client, local or
> remote.

Sqlite doesn't come with a server, but some enterprising tool developer
could write one, right?   :-)

- Richard

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


Re: [sqlite] SQLite remote management tools?

2008-05-15 Thread Federico Granata
>
> I was hoping there might be a client/server management tool out there.
> I would need the source code, since the server part would need to be
> ported to my embedded device.
>
Maybe you haven't yet read this http://www.sqlite.org/serverless.html
There isn't a sqlite server so you can't have a sqlite client, local or
remote.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite remote management tools?

2008-05-15 Thread Richard Klein
Roger Binns wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Richard Klein wrote:
>> Are there any GUI-based tools that provide
>> management of a remote SQLite database?
> 
> SQLite is an in process database and only provides code that ultimately
> calls the operating system's open/read/write/lock/close methods.  There
> is nothing "remote" to it!

True!  Remote management would have to rely on either NFS-style mounting
of remote volumes, or on a client/server mechanism.

I was hoping there might be a client/server management tool out there.
I would need the source code, since the server part would need to be
ported to my embedded device.

Thanks,
- Richard

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


Re: [sqlite] Perf improvements in 3.5.9

2008-05-15 Thread Shane Harrelson
The format of the varints in the DB were not changed.For Varint32s, the
macro support was cleaned up and changes made to use it consistently.   The
MACROs inline the single byte case, so code for this was disabled in the
actual function.  The actual functions were re-implemented to utilize loop
unrolling and some bitwise anding and shifting to minimize the number of
binary operations required.

Varint32s are used quite a bit for storing record structure information
(header size, field size, etc.)

Performance testing was done using the various speed*.test scripts, the
speedtest8.c utility, and valgrind.  The newer implementations showed the
most improvement for large varints (>4 bytes).   Typical "wall-clock"
improvements were about 1%.  When the scripts were changed to force greater
usage of large varints, improvements of up to 4% were measured.  No
slowdowns were observed.

It should also be noted that from this testing, corruption detection for
certain bad varint32 values in headers was improved.


On 5/15/08, Mark Spiegel <[EMAIL PROTECTED]> wrote:
>
> The release notes for 3.5.9 indicate that performance improvements have
> been made around the way integers are stored.
>
> "Performance enhancement: Reengineer the internal routines used to
> interpret and render variable-length integers."
>
> Can someone in dev add some color to this statement?  What types of
> operations does this affect?  Any information on the magnitude of
> improvement and how this is measured?
>
> Best Regards
> ___
> 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] sqlite3_finalize vs sqlite3_closed

2008-05-15 Thread Igor Tandetnik
Joanne Pham <[EMAIL PROTECTED]> wrote:
> Should Iuse sqlite3_finalize or sqlite3_closed after I am done with
> reading/write to the database.

You should call sqlite3_finalize on all prepared statements, then 
sqlite3_close on the database handle.

Igor Tandetnik 



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


[sqlite] sqlite3_finalize vs sqlite3_closed

2008-05-15 Thread Joanne Pham
Hi All,
 Should Iuse sqlite3_finalize or sqlite3_closed after I am done with 
reading/write to the database.
Thanks,
JP


___
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] Perf improvements in 3.5.9

2008-05-15 Thread Mark Spiegel
The release notes for 3.5.9 indicate that performance improvements have 
been made around the way integers are stored.

"Performance enhancement: Reengineer the internal routines used to 
interpret and render variable-length integers."

Can someone in dev add some color to this statement?  What types of 
operations does this affect?  Any information on the magnitude of 
improvement and how this is measured?

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


Re: [sqlite] Help!!! sqlite 3.5.8 crash: access violation

2008-05-15 Thread Dennis Cote
[EMAIL PROTECTED] wrote:
> 
> My DB file is too big, how can I provide it to your guys?

You said a compressed copy of the database file is 18M.

One possibility is to create a bug report ticket at 
http://www.sqlite.org/cvstrac/captcha?nxp=/cvstrac/tktnew and attach the 
compressed database file to the bug report. Then it would be available 
to anyone who needs to look at it. I don't think there is a limitation 
on the size of an attached file, but I could be wrong.

> Even the DB is damaged, sqlite should return an fault result instead of 
> crashing, shouldn't it?
> 

You are correct, it should not crash. That's why it is important to get 
a copy of the database that is causing the problem so that it can be 
used to find the bug.

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


Re: [sqlite] Help!!! sqlite 3.5.8 crash: access violation

2008-05-15 Thread Dennis Cote
[EMAIL PROTECTED] wrote:
> 
> Maybe the database has been damaged.

Possibly.

> 
> The shcema of table "CarImages" is :
> CREATE TABLE CarImages(
>  CarID char(32) NOT NULL,
>  CarNumber char(20) NULL,
>  OpTime datetime NOT NULL ,
>  TSCode char(6) NOT NULL,
>  LaneNum int NOT NULL,
>  PicBigPlate Long null,
>  PicSmallPlate Long null,
>  PicBlackWhitePlate Long null,
>  PicLane Long null,
>  Constraint CarImages_Key Primary Key (CarID)
> );
> 

The only thing I see here is that you have mixed the syntax for a column 
def constraint and a table constraint. You should use either a variation 
with a column definition with a column constraint (which can accept a 
constraint name clause);

 CREATE TABLE CarImages(
  CarID char(32) NOT NULL Constraint CarImages_Key Primary Key,
  CarNumber char(20) NULL,
  OpTime datetime NOT NULL ,
  TSCode char(6) NOT NULL,
  LaneNum int NOT NULL,
  PicBigPlate Long null,
  PicSmallPlate Long null,
  PicBlackWhitePlate Long null,
  PicLane Long null
 );

or a variation with a table constraint definition (which does not allow 
for a constraint name);

 CREATE TABLE CarImages(
  CarID char(32) NOT NULL,
  CarNumber char(20) NULL,
  OpTime datetime NOT NULL ,
  TSCode char(6) NOT NULL,
  LaneNum int NOT NULL,
  PicBigPlate Long null,
  PicSmallPlate Long null,
  PicBlackWhitePlate Long null,
  PicLane Long null,
  Primary Key (CarID)
 );

SQLite does accept the table definition as you have it written without 
any error messages, but it does not agree with the documentation. So 
there is either an error in the documentation or in the parser. You may 
want to file a bug report for this issue.

HTH
Dennis Cote

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


Re: [sqlite] Is this Sorting order right?

2008-05-15 Thread Igor Tandetnik
"Mahalakshmi.m"
<[EMAIL PROTECTED]> wrote
in message
news:[EMAIL PROTECTED]
> I will call this loop 2 times for inserting 2 records at run time.

Which part of "the exact code" is difficult to understand? Can you post 
the code that I can copy, paste, compile, run and see the results for 
myself? You omitted the most interesting part - how you prepare the data 
to be inserted. I have reasons to believe this is precisely where your 
problems lie.

> memcpy(st_SQLITE_DB_Record.s8_ArtistName,tmp_str,strlen(tmp_str)*sizeof(
> short));

strlen counts the number of char (bytes) to the nearest NUL byte, not 
the number of Unicode characters. You multiply this count by two, thus 
copying up to the NUL byte and then again as much. This doesn't look 
right regardless of what's in tmp_str (which you chose not to show, by 
the way).

> u16_SearchResult=sqlite3_column_text16(insert,0);
> printf(u16_SearchResult);

The first parameter of printf is a char*, it expects a narrow string. It 
doesn't know how to print a Unicode string. You would just see garbage 
where each byte (each half of a Unicode codepoint) is interpreted and 
printed as a character in its own right.
-- 
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925 



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


Re: [sqlite] SQLite3 C API question

2008-05-15 Thread P Kishor
On 5/15/08, Jon Dixon <[EMAIL PROTECTED]> wrote:
> I am a Perl programmer, and I am trying to update the DBD::SQLite package to 
> use version 3 rather than version 2 of SQLite (somehow it doesn't seem that 
> anyone else has done this yet).

eh. Doesn't see that you have really looked around. See

http://www.sqlite.org/cvstrac/wiki?p=CompilingFts

and

http://www.sqlite.org/cvstrac/wiki?p=CompilingFtsThree

Even the stock DBD::SQLite 1.14 has been using SQLite 3.4.x for a long
while now.


> Unfortunately, I am really rusty on my C skills, which are needed to handle 
> the glue between Perl and the SQLite routines. Using the API description with 
> the old version of the routines, I believe I have most of them changed over, 
> but the part that steps through and grabs a row at a time is a little beyond 
> me. The old routine used the following command:
>  imp_sth->retval =
>  sqlite_step(imp_sth->vm,
>
>  &(imp_sth->ncols), (const char ***)&(imp_sth->results), (const
>  char ***)&(imp_sth->coldata));
>   to load the proper values in the proper places. Unfortunately for the 
> purposes of this exercise, the sqlite_step interface is now significantly 
> different.
>
>
>  So can someone with more C background help me out with a snippet of code 
> using the new API that will load imp_sth->ncols, imp_sth->results, and 
> imp_sth->coldata in the same manner that the old API would have?
>
>
>  Thanks,
>
>
>  Jon
>
>
>  ___
>  sqlite-users mailing list
>  sqlite-users@sqlite.org
>  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Is this Sorting order right?

2008-05-15 Thread Mahalakshmi.m

typedef struct 
{
  unsigned short s8_ArtistName[256];  

}STRUCT_SQLITE_MY_RECORD;

 UINT32   u32_Return;
 const UINT16 *u16_SearchResult;
 STRUCT_SQLITE_MY_RECORD  st_SQLITE_DB_Record; 
 sqlite3*   db;
 sqlite3_stmt*  insert; 

 
  u32_Return = sqlite3_open("mysqlite.db ", );

  u32_Return = sqlite3_exec(db, "pragma encoding= UTF16", 0, 0, 0);
  u32_Return = sqlite3_exec(db, "create table ARTIST(id  integer primary key
not null , ArtistName  test not null collate nocase )", 0, 0, 0);

  u32_Return = sqlite3_prepare(db,"INSERT INTO ARTIST (ArtistName)
VALUES(?);",-1,,0);
{
I will call this loop 2 times for inserting 2 records at run time.
memset(_SQLITE_DB_Record,0,sizeof(STRUCT_SQLITE_MY_RECORD));
memcpy(st_SQLITE_DB_Record.s8_ArtistName,tmp_str,strlen(tmp_str)*sizeof(
short));
u32_Return = sqlite3_bind_text16(insert,1,(char *)
st_SQLITE_DB_Record.s8_ArtistName,-1,SQLITE_STATIC); -->input will be in
UTF16 format.If it is utf8 I will convert it to utf16 and then I will bind.
u32_Return = sqlite3_step(insert);

u32_Return = sqlite3_reset(insert);
}
  u32_Return = sqlite3_finalize(insert);

  u32_Return = sqlite3_prepare(db,"SELECT ArtistName from ARTIST order by
ArtistName;",-1,,0);
  u32_Return = sqlite3_step(insert);
 
  while( u32_Return == SQLITE_ROW )
   {
u16_SearchResult=sqlite3_column_text16(insert,0);
printf(u16_SearchResult);
printf("\n");
u32_Return = sqlite3_step(insert);
   }
  u32_Return = sqlite3_finalize(insert);
  u32_Return = sqlite3_close(db);

I tried like this and I didn’t got .
   



 
 


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


Re: [sqlite] import files with more than 2GB?

2008-05-15 Thread Michael Lackhoff
On 6 May 2008 at 16:10, Dan wrote:

> On May 6, 2008, at 3:38 PM, Michael Lackhoff wrote:
> 
> > On 5 May 2008 at 11:50, D. Richard Hipp wrote:
> >
> >> The code to do an import is not part of the core SQLite, btw.  It is
> >> part of the CLI.  You can find the code by searching for "import" in
> >> the shell.c source file.
> >
> > I think I somehow managed to get it working. All I had to do is add
> > this line:
> > #define _FILE_OFFSET_BITS 64  /* enable large file support  */
> > to the beginning of shell.c
> > The hint came from here:
> > http://lawlor.cs.uaf.edu/~olawlor/ref/examples/unix/index.html
> > (what would we do without Google !?!)
> >
> > Is it possible to include this (or a better equivalent) to the next
> > version? I hate such hacks where I don't really know what I am doing.
> 
> You might have some luck if you grab cvs as of last night. Some
> changes were made to the configure script that might fix things.

Sorry for my late reply but there is no cvs client on the maschine in 
question but I tried again with v3.5.9 and it doesn't work.
I guess 3.5.9 should also have these changes to the configure script?

--Michael

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


Re: [sqlite] SQLite remote management tools?

2008-05-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Richard Klein wrote:
> Are there any GUI-based tools that provide
> management of a remote SQLite database?

SQLite is an in process database and only provides code that ultimately
calls the operating system's open/read/write/lock/close methods.  There
is nothing "remote" to it!

> I'm looking for a workstation-based tool
> that will allow me to manage a database
> on an embedded device.

If you can mount the device filesystem onto your workstation then any of
the SQLite management tools will work.  The wiki contains a list of
tools http://www.sqlite.org/cvstrac/wiki?p=ManagementTools

If you are using Linux and there isn't an easy way of mounting the
device filesystem on your workstation then have a look at FUSE which
will let you write simple user space code that does so.
http://fuse.sourceforge.net/  Something like sshfs may work for you.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIK/s0mOOfHg372QQRAmuGAJ4iu8x7G4NCaLTHs+seG6kOJcGcYACeNxdl
eQ3vGh0zbayWbmtMRVpVpjI=
=/5XD
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite version 3.5.9

2008-05-15 Thread ajm
On Wed, May 14, 2008 at 3:40 PM, Jay A. Kreibich <[EMAIL PROTECTED]> wrote:

>
>>
>>  WORKAROUNDS:
>>
>>  Or, brute force: Copy the file locally, do your stuff, copy it back.
>>

> Looks like the brute force solution is the only answer here.

(Translated automatically from the Spanish original)

...

There is a special type that we could consider "implementation", called  
"Opportunistic cache". It is linked to the problems of locking files in 
multi-user environments in which different applications can access the same 
data.

In these cases, operating systems have mechanisms so that a user (application 
program) obtain the blocking of an entire file or part thereof. The theory is 
that while maintaining the lock, no one else can modify the file (perhaps 
read), and that once completed modifications, the user unlocks the file so that 
others can use it. However, under certain network applications, and in order to 
improve performance, using a mixed system called "Opportunistic locking", in 
which the user communicates to the system that will use this modality. To do 
this, you get a copy of the entire file, which stores a local opportunistic 
cache. Thus, the transactions are faster than if you have to be conducted 
through the network requests for different pieces, along with the relevant 
requests of lock/unlock. Finally, when the user has completed transactions with 
the file, the server returns an updated copy.

The problem arises when, in the interim, another user requests to use the same 
file. The incidence is particularly prevalent when the file is too big to 
handle. Why then, even for a minor change, the first user may be delayed enough 
to return the amended version to the server. The solution adopted to avoid 
excessive delays, is that, upon receipt of the request of the second user, the 
system sends an order to the first stopping oplock and return the file as it 
stands at this time so that the second user can use it.

Although not without its problems, especially in unreliable networks 
unreliable, the system allows yield increases of around 30%. Not so much by the 
locking system used, for the fact that data have been previously cached by the 
user.

HTH

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


Re: [sqlite] Help!!! sqlite 3.5.8 crash: access violation

2008-05-15 Thread qinligeng
The sqlite3_analyzer-3_5_4 also crash when analyzing my DB:
AppName: sqlite3_analyzer.exe  AppVer: 0.0.0.0  ModName: sqlite3_analyzer.exe
ModVer: 0.0.0.0  Offset: 00028c72

sqlite3 (3.5.9) crash when excute "PRAGMA integrity_check":
AppName: sqlite3.exe  AppVer: 0.0.0.0  ModName: sqlite3.exe
ModVer: 0.0.0.0  Offset: d17e

My DB file is too big, how can I provide it to your guys?
Even the DB is damaged, sqlite should return an fault result instead of 
crashing, shouldn't it?

- Original Message - 
From: "Teg" <[EMAIL PROTECTED]>
To: "General Discussion of SQLite Database" 
Sent: Wednesday, May 14, 2008 10:17 PM
Subject: Re: [sqlite] Help!!! sqlite 3.5.8 crash: access violation


> Hello qinligeng,
> 
> Wednesday, May 14, 2008, 12:58:32 AM, you wrote:
> 
> q1c> When I execute sql statement "delete from Carimages where OpTime
> q1c> <'2008-05-01 00:00:00'"  in my database, sqlite3 crashed.
> q1c> The Exception Information reported by XP is:
> q1c> Code: 0xc005   Flags:0x  
> q1c> Record: 0x   Address: 0x00406652
> 
> q1c> The sqlite3.exe is downloaded from
> q1c> http://www.sqlite.org/sqlite-3_5_8.zip
> q1c> The database file is to big ( about 600M, after compressed by
> q1c> WinRAR, the size is 18M), so I can't upload here.
> q1c> ___
> q1c> sqlite-users mailing list
> q1c> sqlite-users@sqlite.org
> q1c> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> I have a smallish DB that will do that here. It's interesting, the
> commandline tool Sqlite3.exe simply reports it's damaged. The
> statically linked version I use in my program will crash my program. I
> traced it down to "sqlite_step" but, no further.
> 
> I'd try an integrity check on your DB. Mine's definitely damaged.
> 
> 
> 
> -- 
> Best regards,
> Tegmailto:[EMAIL PROTECTED]
> 
> ___
> 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