-
Notifications
You must be signed in to change notification settings - Fork 31
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
Consider defaulting to another serializer than binary #91
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Alternative serializers like Message Pack require you to annotate the properties of your objects to identify which properties to serialize. Which properties of your entities do you need to serialize at minimum for NHibernate cache to function correctly? Child collections / Many-to-one properties / etc? |
This is implementation specific. Some caches do not need serialization at all. Those needing it usually require serializing the complete state. This state is not the entities or collections themselves, but their "dehydrated" versions, which means, simple arrays of atomic types. Some caches also adds some of their own state in the serialized data though. |
Hi, |
We ended up using the JsonCacheSerializer with StackExchangeRedisCache when moving away from binary serializer. It seemed the only reasonable option. Our configuration is :
Only other thing that needed to be done is to ensure the |
This comment was marked as outdated.
This comment was marked as outdated.
No need, see #117. But 5.9 is not yet released. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
5.9.0 is now released. |
Works beautifully without having to use my own ConfigureJsonCacheSerializer() code. Many thanks. |
Binary serialization (
BinaryFormatter
) is made obsolete in .Net 5.Some caches use it by default. They have to be made obsolete themselves for .Net 5, or changed for another serialization default when possible.
(Issue extracted from nhibernate/nhibernate-core#2603.)
The text was updated successfully, but these errors were encountered: