jsondb-core icon indicating copy to clipboard operation
jsondb-core copied to clipboard

Symlinks broken

Open meza opened this issue 1 year ago • 2 comments

Seems like the database gets rewritten every time there's a modification to the data. This makes it impossible to use symlinks

meza avatar Nov 27 '23 11:11 meza

the changes are written to a tmp file then moved: https://github.com/Jsondb/jsondb-core/blob/master/src/main/java/io/jsondb/io/JsonWriter.java#L391

laymanmu avatar Jan 19 '24 19:01 laymanmu

This is by design.

To support atomicity I create a temporary file, if everything succeeds then the tmp file replaces the original file in one IO call. This is the only way to guarantee atomicity.

FarooqKhan avatar Jan 24 '24 11:01 FarooqKhan