kundera icon indicating copy to clipboard operation
kundera copied to clipboard

Locks

Open bsideup opened this issue 12 years ago • 9 comments

Hello everyone!

Does Kundera supports Jpa locking? ( http://en.wikibooks.org/wiki/Java_Persistence/Locking#JPA_2.0_Locking )

Thanks!

bsideup avatar May 27 '13 10:05 bsideup

Nope. Do you any thoughts to share how actually such locking mechanism should work over nosql databases?

-Vivek

mevivs avatar May 27 '13 11:05 mevivs

http://wiki.apache.org/cassandra/Locking

Yep.

bsideup avatar May 27 '13 11:05 bsideup

It's bit old thread. Does Cassandra support this?

-Vivek

mevivs avatar May 27 '13 11:05 mevivs

Hard to say.

But AFAIK Hector support this: https://github.com/hector-client/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/locking/HLockManagerImplTest.java

bsideup avatar May 27 '13 11:05 bsideup

AFAIK, Cassandra doesn't.

Such custom implementation at client level may be possible, AFN Kundera doesn't support this.

-Vivek

mevivs avatar May 27 '13 12:05 mevivs

Hi

There are no locking in Cassandra, but if you want to implement it please take a look at the Cages library - https://code.google.com/p/cages/ Note, that it requires ZooKeeper

Regards, Oleksandr

OleksandrSemenov avatar May 27 '13 13:05 OleksandrSemenov

Locking in a variable-consistency and multiple-client (each with a possible lock) doesn't seem a sane idea.

pires avatar May 30 '13 11:05 pires

actually that Cassandra now supports optimistic locking through lightweight-transactions - this could be implemented in Kundera. without such locking - how do you suggest to avoid persisting a stale entity?

asafd1 avatar May 25 '16 14:05 asafd1

Optimistic locking is one of the many advantages of lightweight transactions. IMHO handling it at higher level (modeling the databases accordingly) would be more appropriate than implementing it in a NoSql datastore mapper like Kundera.

This can be achieved using native querying on Cassandra through Kundera. Please let us know how important it is, your usecase and if we can discuss the best way to achieve it?

We can connect on Gitter

-Karthik

karthikprasad13 avatar May 26 '16 17:05 karthikprasad13