Skip to content

Remove locks from UpdateTimestampsCache #2742

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

Merged
merged 1 commit into from
Apr 30, 2021

Conversation

hazzik
Copy link
Member

@hazzik hazzik commented Apr 28, 2021

See #2735

Hibernate has done [it] a long time ago to improve performance.

Possible breaking change:

In theory the read/write locking prevents that IsUpToDate would return stale data, but that holds true only when one instance of the application is running. In case multiple application instances are running then IsUpToDate may return stale data due to another application instance writing data at the same time. So we could remove the locking entirely as Hiberanate did or add a configuration setting for disabling it.

Originally posted by @maca88 in #2735 (comment)

@gokhanabatay
Copy link
Contributor

gokhanabatay commented Apr 28, 2021

@maca88 When we use redis pub/sub distributed cache in your implementation non cached entities causes too much syncronization events. Think about a configuration in entity mapping Cache.Never() that tells this entity never cached with query cache or entity cache ever.

If this approach is ok I could implement this in NHibernate and FluentNHibernate libraries.
For performance needs this is absolutly necessary.

There is also locks in NHibernate.Caches.StackExchangeRedis.DistributedLocalCacheRegionStrategy

@gokhanabatay
Copy link
Contributor

5.3.9 released but does not contains this pr, it was tagged as next minor am I missing something. @fredericDelaporte @hazzik

@fredericDelaporte
Copy link
Member

Current minor is 5.3.x. Next minor will be 5.4.x, or 6.0.x if we decide to go for a next major instead.

@hazzik
Copy link
Member Author

hazzik commented Jul 4, 2021

@gokhanabatay yes, this was for 5.4.x, because we cannot change the behavior or add new features in 5.3.x

@fredericDelaporte
Copy link
Member

@gokhanabatay, in case you were not knowing, you can still use this feature by using the latest MyGet package.

@gokhanabatay
Copy link
Contributor

@fredericDelaporte thanks we are using myget latest nhibernate package for performance needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants