{"issue":{"created_at":"2011-11-18T10:27:51Z","state":"open","updated_at":"2011-11-19T12:41:59Z","user":{"gravatar_id":"6f4f987119e2cf2e4e0f9200f3d9f83a","id":1080242,"url":"https://api.github.com/users/malamut2","login":"malamut2","avatar_url":"https://secure.gravatar.com/avatar/6f4f987119e2cf2e4e0f9200f3d9f83a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":3,"body":"\r\nOk, I realize that this is much to ask, but I'm filing this request anyway. :)\r\n\r\nI have a Java program writing lots of stuff into a BaseX database. If I kill this program the hard way, like 'kill -9' on Linux or by pressing the 'Stop' button in Eclipse, so that my ShutdownHook with the Close() is not executed, I may end up with a broken database.\r\n\r\nSuch a broken database will not be recognized as 'broken' immediately. Simple queries like an auto-cropped '//*' from the BaseX GUI will usually still work. Complex queries, however, will produce problems like IndexOutOfBounds, NegativeArraySize, or OutOfMemory (the latter probably corresponding to 'RidiculouslyLargeArraySize' ;) ). Such a database will also result in errors when trying to export it.\r\n\r\nIn other words: there's no way to recover the data - simply hope there's a recent backup somewhere...\r\n\r\nIdeally, BaseX would flush its written data to disk in such a sequence that no bigger problem than loss of the changes of the last few seconds can occur. At least, it should be possible to automatically recognize broken databases so that a crashed and restarted service can automatically recover from the latest backup. The lock file discussed in a separate issue can be a first step into this direction since it signals an unclosed database, but it would be great to have more than just that.\r\n","assignee":null,"id":2278792,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":279,"labels":[],"title":"Make BaseX Crash-Proof","closed_at":null,"html_url":"https://github.com/BaseXdb/basex/issues/279","milestone":null,"url":"https://api.github.com/repos/BaseXdb/basex/issues/279"},"action":"created","comment":{"created_at":"2011-11-19T12:41:59Z","updated_at":"2011-11-19T12:41:59Z","user":{"gravatar_id":"6f4f987119e2cf2e4e0f9200f3d9f83a","id":1080242,"url":"https://api.github.com/users/malamut2","login":"malamut2","avatar_url":"https://secure.gravatar.com/avatar/6f4f987119e2cf2e4e0f9200f3d9f83a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"\r\nThank you very much! Such a validation flag, together with the existing backup functionality, would indeed solve my immediate problem. I like the idea of implementing the 'big' solution along with ACID transactions in the more remote future.\r\n","id":2798626,"url":"https://api.github.com/repos/BaseXdb/basex/issues/comments/2798626"}}