Hi,

I'm using OrientDB released version 2.1.0, a plocal embedded database with 
the Document API.
Say I do the following multi-threaded operation:

1. THREAD_1 reads ODocument "X" record
2. THREAD_2 deletes ODocument "X" before THREAD_1 updates it
3. THREAD_1 updates ODocument "X"
4. THREAD_1 saves/commits ODocument "X" after THREAD_2 has deleted it

When I execute this, there are no errors or exceptions even though I saved 
a document that no longer exists. However, if I try to read the document 
afterwards, I see that it is deleted.
What would you suggest for handling these cases? 

I found this: 
http://orientdb.com/optimistic-vs-pessimistic-concurrency-when-locking-is-good/
((OStorageEmbedded)db.getStorage()).acquireWriteLock(final ORID iRid)
Although, OStorageEmbedded does not seem to exist anymore. I'm assuming I 
use "OAbstractPaginatedStorage"?

I thought I would see a concurrent modification exception or something but 
it seems to silently fail.
What is the best way I should be handling this?

Thanks!

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to