Re: Question regarding EDS
- Posted by petelomax 1 week ago
- 118 views
I guess the thrust of my comment is why do I have these problems. A database is useless if it is not reliable.
I believe the core problem is that database.e is not transactional (there is no commit/rollback handling) and it is not a separate process. A crash anywhere else in your application may perform some writes but leave some other updates in memory that simply never make it to disk, and that way the database becomes inconsistent. If anything the problem is more likely to do with caching rather than database.e per se, though maybe things would be improved (potentially at a significant performance cost) by adding a few flush(current_db) to database.e (just don't ask me where).
I solved many problems in edita by adopting a close-often approach. All database handling is done by eaedb.e and almost all the routines in that call db_close() before returning. The overhead is certainly measurable, but acceptable in that particular application, and nowadays database corruptions seem to be pretty rare - not that I can categorically rule out other factors, in particular moving from rds eu to phix, or even win98 to win10, or whether my old box had flakey ram, etc.
Do you have any ideas for alternate ways to implement a database in euphoria?
No. I do however rather fancy some kind of (cross platform|properly documented) builtins/odbc.e for Phix, but, y'know, too many other things on me plate.