r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[SQLite] C library embeddable DB .

Gabriele
7-Nov-2010
[1140x2]
As Gregg said, it still needs to be a block! otherwise WAIT will 
complain (IIRC).
most likely, you'll only have the event port in the wait list, so 
it's just a matter of removing it and adding it back later. I can't 
guarantee this works 100% because I haven't tested it.

another alternative could be:


4) don't use face timers, but rather replace do-events with something 
like:

    forever [
        wait 1
        do-your-sql-calls
    ]


You'll still have other events happening while you're doing your 
sql calls in this case though, not sure if that can be a problem. 
The cleanest solution would be to change the driver so it does not 
wait, but I don't know SQLite so I can't say how easy that would 
be.
ddharing
7-Nov-2010
[1142]
Thanks everyone for your explanations and suggestions.
GrahamC
7-Nov-2010
[1143x4]
There are several sqlite drivers ... are they much the same?
Also you could try opendbx which doesn't use 'wait
and has a driver for sqlite I think
http://rebol.wik.is/index.php?title=OpenDBX&highlight=opendbx
ddharing
7-Nov-2010
[1147]
Thanks, Graham. I'll take a look at that option.
Claude
8-Nov-2010
[1148]
ty
amacleod
7-Mar-2011
[1149x2]
Is there a way to force sqlite to release a database. 


I get a currupt db now and again and I want to automate the process 
of re copying an older version over it once I detect it is currupted 
using a try block.


But once the database is accessed it won't let me delete it or disconnect 
from it. Anywayaround this?
And has anyone been experienceing curruption to their db's...looks 
like binary characters get written into some fields randomly. Other 
people do not seem to be having this problem with the program on 
their computers.
Janko
7-Mar-2011
[1151]
I haven't yet seen a corrupt sqlite db so far. I am having like separate 
1000 databases "running". On what OS are you seeing this?
GrahamC
7-Mar-2011
[1152]
I"d bet it's being used on a desktop ....
amacleod
7-Mar-2011
[1153]
xp and vista. I just had the issue on vista. I do not remember if 
it has occured on my xp machine.

Why Graham? desktop as opposed to server?
ddharing
7-Mar-2011
[1154]
What version of SQLite are you using?  What is the pragma setting 
for synchronous? 2 is the safest. Are any processes that use the 
database still running when you have the problem trying to delete 
the database files?
amacleod
7-Mar-2011
[1155x2]
Not sure on the version? (you are talking about the dll? or .r?)
Pragma setting? Not familiar with this.


Yes, my script is running still. That's my problem. I wanted to over 
write without having to close script down...I worked that out with 
a restart...good enough for now.
.r = 1.0.4

i see its up to 1.0.6... I'll try out the newer version...thanks
Kaj
7-Mar-2011
[1157]
I'm regularly having corruption in my Firefox 3.5 bookmarks, which 
are stored in SQLite
ddharing
7-Mar-2011
[1158x2]
I'm referring to the SQLite version. The current is 3.7.5. You can 
check the synchronous setting by executing the following query -- 
pragma synchronous. It will return a 0 (off), 1(normal) or 2 (full). 
See http://sqlite.org/pragma.html#pragma_synchronous.


I've had database corruption before because I didn't backup the files 
correctly. It's best to use the backup API and not just copy the 
files.
Is there just one process accessing the files? I also use the WAL 
journal mode for better concurrency. Much less chance of getting 
SQLIte file locks when multiple processes are reading/writing the 
database. See http://sqlite.org/pragma.html#pragma_journal_mode.
GrahamC
8-Mar-2011
[1160:last]
desktop because people run all sorts of junk on their PCs causing 
corruption!