SQL Lite Journal file

I use sql lite files for data storage.
I had a client who was storing the data files on a server… their network burped and it couldnt write the file.
Now there is a -journal file in the same directory.
I cannot move, copy, or delete this file.

1). How do I check for this type of error to throw a warning or something?
2) What do other people do… if there is a server access issue… force them to save locally?
3). What is the journal file for? Why can’t it be looked at or deleted?

Also… if I dont have a 600dpi printer… how do I “test” my reports? Any suggestions appreciated.

The Rollback Journal

Don’t do this. Ever.

[quote=133265:@Tim Turner]I use sql lite files for data storage.
I had a client who was storing the data files on a server… their network burped and it couldnt write the file.
Now there is a -journal file in the same directory.
I cannot move, copy, or delete this file.

1). How do I check for this type of error to throw a warning or something?
2) What do other people do… if there is a server access issue… force them to save locally?
3). What is the journal file for? Why can’t it be looked at or deleted?[/quote]

Not sure I’d put a sqlite file on almost any file server
http://sqlite.org/faq.html#q5

as as storage expert (or that is what my title says these days), I would not put a SQLite or other single file data store on a shared drive or non-local/directly attached drive. When writing to a shared drive or a network drive (NFS/AFS/CIFS/SMB/etc) if there is a blip on the network (which happens all the time, even in the best of networks), you now have data loss/data corruption. I have been party to people putting the file on a network drive and all a sudden it is corrupt and ALL data is lost.

I strongly recommend not doing it.

if you need to have a single SQLite (or similar) data file for multiple hosts to access, I would use something like CubeSQL on a centralized server, with it doing all the IOs to the SQLite file, and your hosts (clients) would talk to the CubeSQL server.

OK I get it loud and clear but I can’t prevent my clients from doing this… they want to “share the file between computers” and then their genius tech guy sets up this shared folder deal without consulting us at all…

A couple of suggestions:

#1 Sell them a ‘server’ application :wink:
#2 Add some code to check if the disk with the database file on it is a local disk or remote. NSURL has a function for this. If the file is on a remote server, prevent them from using it and point them to your ‘server’ application :slight_smile:

[quote=134111:@Sam Rowlands]A couple of suggestions:

#1 Sell them a ‘server’ application :wink:
#2 Add some code to check if the disk with the database file on it is a local disk or remote. NSURL has a function for this. If the file is on a remote server, prevent them from using it and point them to your ‘server’ application :)[/quote]
or popup a message at startup of the app announcing that they will have data corruption/data loss due to the data being on a shared drive.

Any pointers to articles or info on creating a server application?

We are working on a web application with a backend mysql database…
debating whether to just force the backend of the ‘server’ app to be
our own web database vs. a network server.

I would think the network server situation would create more support calls
which we don’t want.