Comments (2)
Hi Joel,
- Deep copying was done so that the objects in memory would be disconnected from the objects returned by the various query method.
- Not doing deep copy has one side effect, once you have queried and obtained object(s) from the JsonDB you can then change the contents of that object and those changes would also be done in the JsonDB memory, this would not be issue normally, however, it might cause subtle bugs especially in case of the update methods. You might end up assuming that I have changed the object and it is all done however the change will not be written to the files. This would mean data in cache is out of sync with data in the files. However, if you continue to invoke the update methods without fail you can choose not to do deep copy and it should all work fine.
- Data files can be loaded in 2 ways. a) at the time of constructor invocation everything in data folder is loaded up front. b) you can invoke reload() method to load a particular collection again on demand. You can also register for event listners (though they don't work on mac) and reload based on events received when underlying data files change
Thanks
from jsondb-core.
I do not plan to change this behaviour at the moment. In future if time permits i can try and make it configurable, until then i am going to mark it wont fix
from jsondb-core.
Related Issues (20)
- Generated resources during test execution not deleted afterwards
- No way to "flush" database HOT 2
- Provide security contact info HOT 2
- Modified json file make collectionExist return false HOT 2
- Android does not find any classes HOT 2
- Recursive data structures. Cycles not supported
- JDK 15 compliance
- jsonDBTemplate.findAll(Instance.class, comparator) HOT 4
- xpath lower-case() find. HOT 1
- ndjson parse example
- File Writes Are Not Thread Safe HOT 2
- invalid json format HOT 1
- No class found with @Document Annotation and attribute collectionName as: User, Android HOT 2
- Method for fast retrieval of collection size
- TURN OFF ERROR HANDLING IN MAVEN RELEASES, PLEASE
- Bug: Multiple SchemaUpdates (Rename) not possible
- One file for each item in a collection HOT 3
- Symlinks broken HOT 2
- getCollection always return the last item HOT 1
- Failed to acquire lock for collection file ClosedChannelException
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsondb-core.