New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing some documents requires application restart #6080
Comments
Hi @kerner1000 Could you please share some additional info about your application? How are you using OrientDB? Embedded or remote? A little hint (but it's definitely a guess), try a Thanks Luigi |
Hi Luigi About our setup: We establish a db connection basically at application startup:
and shut it down only when the application shuts down.
For all reading and writing we use the same instance of db and do everything single threaded (multi thread access was causing us some other headaches) after each document alteration, we call We do not use transactions. We could not figure out a decent way to perform I would be great if you could share some 'best practices' on saving documents, caching and maybe multi thread access! Many thanks for helping! Best, |
Hi Alex OrientDB multi-threading can be tricky, because ODatabaseDocumentTx is not thread safe. What we recommend is that every thread opens and uses its own db connection, this should be safe in general. About the save operations, if you are working in remote I suggest you to do small transactions instead, this way you will have network communication only at commit() and not at every save(), with obvious performance improvement. Just pay attention to the transaction isolation when you mix java and SQL (http://orientdb.com/docs/2.1/Transactions.html) Thanks Luigi |
Hi, Can i add something on top of this, do an 'OPartitionedDatabasePool.acquire()' at the start of the application is not really the way orientdb was thought, the correct way to use it creating the pool at startup, and acquiring/releasing the ODatabaseDocument on group of operations/methods, with the standard pattern:
or more concise java7 syntax.
this follow the same pattern of many ORMs or of JDBC with the a connection pool. |
Hi all, thanks for your explanations. Can I find somewhere documentation about database caching? ( |
Hi guys, please never call |
I have difficulties keeping my table and the database in sync. After modifying some documents, my GUI does not display the latest changes.
Also a
database.reload();
database.close();
database.open();
does not help.
Only after restarting the whole application, I can see the changes.
Is there anything going on behind the scenes when shutting down the JVM? How can I ensure I query for the latest version of my documents?
The text was updated successfully, but these errors were encountered: