Re: [sqlite] Delete a database file

2004-02-26 Thread ben . carlyle
- Forwarded by Ben Carlyle/AU/IRSA/Rail on 27/02/2004 09:54 AM -


Ben Carlyle
27/02/2004 09:34 AM


To: "Benoit Gantaume" <[EMAIL PROTECTED]>@CORP
cc: 
Subject:Re: [sqlite] Delete a database file

Benoit,





"Benoit Gantaume" <[EMAIL PROTECTED]>
26/02/2004 08:45 PM

 
To: <[EMAIL PROTECTED]>
cc: 
Subject:[sqlite] Delete a database file


> I just want to suppress a database file.
> But it's impossible to do it from the procees that created or opened the 
database even if i closed it!
> I guess that I do not close properly the database.
> The only way to be able to remove the file is to close the process that 
used the database...
> Do you have some tip?

Under unix, just unlink it. The file will actually be deleted when your 
process closes it. Under Windows, you can't delete any open file of any 
kind, ever. You have to close the file, first. If you issue sqlite_close 
calls for each sqlite* pointer you recieved from sqlite_open the file will 
be closed.

But the question is, why do you want to close the file? Just to free up 
some space? Why are you using an on-disk database when you could use an 
in-memory database?

Benjamin.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] multithreading

2004-02-26 Thread ben . carlyle
- Forwarded by Ben Carlyle/AU/IRSA/Rail on 27/02/2004 09:53 AM -


Ben Carlyle
27/02/2004 09:49 AM


To: [EMAIL PROTECTED]@CORP
cc: 
Subject:Re: [sqlite] multithreading

Dave,





[EMAIL PROTECTED]
26/02/2004 04:56 PM

 
To: [EMAIL PROTECTED]
cc: 
Subject:[sqlite] multithreading


>   Since I'm 
> debugging, I'm crashing a lot before I have a chance to sqlite_close() 
> the database.  Is that the problem?  If it is, is there any way to 
> unwedge a database if the app crashes before closing it?

sqlite uses operating-system locks. When your process terminates, the 
operating system will remove all locks that process owned. I presume from 
the fact you can delete the file while it's still locked (and therefore 
open) that you're running a unix variant? I would be checking the output 
of lsof to see exactly which process still had the file open.

> I'm trying to access the database from two threads: the UI thread 
> mostly reads and occasionally updates rows, while the network thread 
> loads new messages and inserts them.  Will that work, or do I just 
> misunderstand how SQLite does multithreading?

It is important that each thread has its own sqlite*, each coming from a 
separate sqlite_open call. If that condition is met, nothing should 
actually misbehave. Be warned, though, that each thread will lock out all 
other threads while it is querying or modifying the database. If any 
thread locks the database for too long, the other threads attempting to 
access the database will have SQLITE_BUSY returned. It is possible to hack 
blocking locks into sqlite to make the waiting thread sleep, instead, but 
I'll leave that as an exercise for the reader (or drh).

Benjamin



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] multithreading

2004-02-26 Thread ben . carlyle
"rumcais" <[EMAIL PROTECTED]>
26/02/2004 05:16 PM

 
To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc: 
Subject:RE: [sqlite] multithreading


> I've make some experiments around accessing the SQLite database fom 
concurent processes at the same time
> and I find it work good when I'm using transactions every time I touch 
the database.
> When I don't, it corrupt the database file sometimes.

In sqlite,

INSERT INTO foo VALUES("bar");
INSERT INTO foo VALUES("baz");

is equivalent to

BEGIN TRANSACTION;
INSERT INTO foo VALUES("bar");
END TRANSACTION;
BEGIN TRANSACTION;
INSERT INTO foo VALUES("baz");
END TRANSACTION;

If you are getting database corruption then you are running into a very 
strange and very serious bug, or your code (not sqlite) is corrupting the 
database (in which case it is still a very serious bug, just not in sqlite 
:). I suggest you reinvestigate and report. If its reproducable it should 
be possible to track down.

Benjamin.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Bug database question: a fix that isn't really

2004-02-26 Thread James W. Walker
If a bug ticket is marked "fixed", and I add a remark that it still 
seems to be broken, will someone notice, or is it better to create a 
new ticket?

The ticket in question is 627.
--
  James W. Walker, ScriptPerfection Enterprises, Inc.
  
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] Debian bug report #234625

2004-02-26 Thread Andreas Rottmann
tags 234625 +upstream +patch
forwarded 234625 [EMAIL PROTECTED]
thanks

I got this bug report. It's reproducible on my system - see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=234625 for the full
bug log.

FWICT, this is already fixed in CVS. Richard, can you confirm?

,
| $ ltrace sqlite ~/.imms/imms.db 'select rating from Rating;'
| [cut by MP]
| sqlite_exec(0, 0xbcb5, 0x08049520, 0xbfffe610, 0xbfffe60c 
| --- SIGSEGV (Segmentation fault) ---
| 
| Notice that the first parameter is a null pointer.
| This is the static global variable db in shell.c that seems to be never
| set to anything useful.
| Just setting it in open_db, like in this patch, helps.
| But I don't know if it's the right place to do it.
| 
| --- sqlite-2.8.12.orig/src/shell.c
| +++ sqlite-2.8.12/src/shell.c
| @@ -528,6 +528,7 @@
|exit(1);
|  }
|}
| +  db = p->db;
|  }
`

Regards, Andy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Re: Build system update

2004-02-26 Thread Andreas Rottmann
Andreas Rottmann <[EMAIL PROTECTED]> writes:

> Hi!
>
> I intend to commit the following changes to CVS:
>
> * Update of generated/libtoolized files: config.guess, config.sub,
>   configure, ltmain.sh
> * Removal of libtool, which is generated by configure
> * Some changes to Makefile.in, which adds better support for newer libtool
>
> If anybody has arguments against this, please speak up.
>
I've committed this now.

Andy
-- 
Andreas Rottmann | [EMAIL PROTECTED]  | [EMAIL PROTECTED] | [EMAIL 
PROTECTED]
http://yi.org/rotty  | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint  | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

The best way to accelerate a Windows machine is at 9.81 m/s^2

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Debian bug report #234625

2004-02-26 Thread D. Richard Hipp
Andreas Rottmann wrote:
tags 234625 +upstream +patch
forwarded 234625 [EMAIL PROTECTED]
thanks
I got this bug report. It's reproducible on my system - see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=234625 for the full
bug log.
FWICT, this is already fixed in CVS. Richard, can you confirm?

Confirmed.  That problem is fixed in CVS.

--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] Bug database question: a fix that isn't really

2004-02-26 Thread James W. Walker
You can change the status back to "active" if you want.  That
seems easier than creating a new ticket.
And how does one do that to a ticket that was created anonymously? 
Note that I am not logged in, because I don't see any way to create 
an account on your bug-tracking system.
--
  James W. Walker, ScriptPerfection Enterprises, Inc.
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] Bug database question: a fix that isn't really

2004-02-26 Thread James W. Walker
Will Leshner <[EMAIL PROTECTED]> wrote:

Can't you just click the Edit link?
Duh!  I guess I just assumed that only the developers should be able 
to change the status of a ticket.  At least, if I were writing a bug 
tracking system, I wouldn't let anonymous users change a status.
--
  James W. Walker, ScriptPerfection Enterprises, Inc.
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] PHP extention

2004-02-26 Thread [EMAIL PROTECTED]
Pierre-Alain Joye wrote:

On Sun, 15 Feb 2004 13:10:59 -0800
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
 

Im a bit confused as to where i get a sqlite.so for php.
When i build sqlite from source it does not place a sqlite.so anywhere
in my system.
Using 'pear install sqlite' isnt good becuase its an out of date
version.
   

You may ask on pecl-dev list (see http://pecl.php.net/support.php). If
you install using "pear install sqlite" using php4 you will get the php4
version. PHP5 is bunlded with the sqlite extension _and_ sqlite itself.
See the configure options to enable it or to set the available options.
hth

pierre

 

For whatever reason pear install sqlite is not working now. It gets 
through the configure, then starts the build and errors with:
[Error]
In file included from /usr/include/php/main/php.h:106,
from /tmp/tmpJTlGSS/SQLite-1.0.2/sqlite.c:29:
/usr/include/php/main/build-defs.h:93:10: #include expects "FILENAME" or 

make: *** [sqlite.lo] Error 1
`make' failed
[/Error]

Why does it seem so hard to get a sqlite.so, sqlite.com should really 
have it in part of its download section...
Is there a way i can build it from source somewhere? or can someone here 
just host it or send it to me one way or another? I dont have the option 
of using php5 right now.
Thanks, eny.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] Delete a database file

2004-02-26 Thread Christian Smith
On Thu, 26 Feb 2004, Benoit Gantaume wrote:

>Hi,
>Here is my pb:
>
>I just want to suppress a database file.

When you say suppress, do you mean you only want a temporary database?

If so, use the filename ":memory:" when opening the database, and you'll
get a memory only database which will go away when you finish.


>
>But it's impossible to do it from the procees that created or opened the
>database even if i closed it!
>
>I guess that I do not close properly the database.

You use sqlite_close?

>
>The only way to be able to remove the file is to close the process that
>used the database...
>
>Do you have some tip?
>
>Thx
>
>Regards
>
>  __
> Benoit Gantaume
>  Dmailer vous facilite la gestion de l'information.
>  Phone :
>  Fax :
>  Email : +33 (0) 4 91 29 32 81
>  +33 (0) 4 91 76 39 27
>  [EMAIL PROTECTED]
>
>
>DISCLAIMER:
>
>
>The integrity of this message cannot be guaranteed on the Internet. Dmailer cannot 
>therefore be held responsible for the contents of this e-mail.
>This e-mail may contain proprietary information some or all of which may be legally 
>privileged. It is for the intended recipient only.
>If an addressing or transmission error has misdirected this e-mail, please notify the 
>author by replying to this e-mail.
>If you are not the intended recipient you must not use, disclose, distribute, copy, 
>print, or rely on this e-mail.
>Any views expressed in this message are those of the individual sender, except where 
>the sender specifically states them to be the views of Dmailer
>
>
>Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention 
>exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est 
>interdite.
>Tout message électronique est susceptible d'altération. Dmailer décline toute 
>responsabilité au titre de ce message s'il a été altéré, déformé, falsifié ou encore 
>diffusé sans autorisation.
>

-- 
"The problem with the French is that they don't have a word for entrepreneur"
  George W. Bush

--
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Bug database question: a fix that isn't really

2004-02-26 Thread D. Richard Hipp
James W. Walker wrote:
If a bug ticket is marked "fixed", and I add a remark that it still 
seems to be broken, will someone notice, or is it better to create a new 
ticket?

The ticket in question is 627.
You can change the status back to "active" if you want.  That
seems easier than creating a new ticket.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] Bug database question: a fix that isn't really

2004-02-26 Thread Will Leshner
On Feb 26, 2004, at 5:46 PM, James W. Walker wrote:

You can change the status back to "active" if you want.  That
seems easier than creating a new ticket.
And how does one do that to a ticket that was created anonymously? 
Note that I am not logged in, because I don't see any way to create an 
account on your bug-tracking system.

Can't you just click the Edit link?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] Delete a database file

2004-02-26 Thread Benoit Gantaume



Hi,
Here is my pb: 
 
I just want to suppress a database 
file.
 
But it's impossible to do it from the procees that 
created or opened the database even if i closed it!
 
I guess that I do not close properly the 
database.
 
The only way to be able to remove the file is to 
close the process that used the database...
 
Do you have some tip?
 
Thx
 
Regards
 


  
  
__
  

Benoit GantaumeDmailer vous 
  facilite la gestion de l’information.
  
Phone :Fax :Email :
+33 (0) 4 91 29 32 81+33 (0) 4 91 76 39 27[EMAIL PROTECTED]
DISCLAIMER:The integrity 
of this message cannot be guaranteed on the Internet. Dmailer cannot therefore 
be held responsible for the contents of this e-mail. This e-mail may contain 
proprietary information some or all of which may be legally privileged. It is 
for the intended recipient only. If an addressing or transmission error has 
misdirected this e-mail, please notify the author by replying to this e-mail. 
If you are not the intended recipient you must not use, disclose, 
distribute, copy, print, or rely on this e-mail. Any views expressed in this 
message are those of the individual sender, except where the sender specifically 
states them to be the views of Dmailer Ce message et toutes les 
pièces jointes sont confidentiels et établis à l’intention exclusive de ses 
destinataires. Toute utilisation ou diffusion non 
autorisée est interdite. Tout message 
électronique est susceptible d’altération. Dmailer décline toute responsabilité 
au titre de ce message s’il a été altéré, déformé, falsifié ou encore diffusé 
sans autorisation.