Comments (7)
Commit 58eb3dd adds a small note that using TinyDB from multiple processes is not supported.
from tinydb.
Am I correct in assuming that you're running the Python scripts in parallel from multiple Python instances?
from tinydb.
Yes?
On Mon, Oct 26, 2015 at 9:21 PM Markus Siemens [email protected]
wrote:
Am I correct in assuming that you're running the Python scripts in
parallel from multiple Python instances?—
Reply to this email directly or view it on GitHub
#72 (comment).
from tinydb.
Okay, that's propably the problem. TinyDB isn't designed to be used from multiple Python instances in parallel. We don't even support usage from multiple threads in one Python instance. I don't think we can solve this issue without adding a lot of complexity by adding some sort of read/write locking.
from tinydb.
@dirkk0 I would recommend writing a storage that uses file locking. If you can't access fcntl
-like syscalls then maybe you can try a more naive approach: E.g. creating a lockfile, then deleting it when a modification is done and having your other processes waiting until your lockfile is deleted then you can achieve parallelism.
Although I hope you'd opt for a more complex route and perhaps direct all read/write requests to a single DB process using some form of IPC (e.g. XMLRPC).
from tinydb.
Thanks for the reply! Since re-opening the database works for me, and efficiency is not an issue in this particular case, everything is fine for me.
I still consider this a bug, though. So feel free to close this issue, if you think different.
Thanks again,
Dirk
from tinydb.
I think this is a wont-fix kind of bug as it is due to TinyDB's design. Nevertheless this should be documented better.
from tinydb.
Related Issues (20)
- Modifying documents returned by `search` modifies the query cache
- Can't use lists/dicts as arguments to `Query.test`
- how to flush Tables with CachingMiddleware(JSONStorage)) HOT 2
- de-serialization Query() statement for search is there a way not use eval HOT 3
- Data Corruption vulnerability on TinyDB version 4.7.1 HOT 5
- Does tinyDB support multi-thread/process access ? HOT 2
- TinyDB 4.8.0 issue HOT 2
- -1073741571 (0xC00000FD) something interesting occured. HOT 2
- Are there any option to persist query caches? HOT 1
- Json decoder error when reading DB from multiple processes HOT 2
- Broken link in documentation.
- is there any way to speed up deletion HOT 1
- Document ID and existing unique value in the document HOT 1
- Search documents that do not have a specific key
- A simple implementation for update_multiple_by_id
- bug: MemoryStorage incorrectly keeps references to nested dicts
- json context manager
- How can we ensure uniqeness when inserting HOT 1
- Questions about Copilot + Open Source Software Hierarchy
- What specific scenarios can this database be used in?
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 tinydb.