spring-projects / spring-session

Spring Session
https://spring.io/projects/spring-session
Apache License 2.0
1.87k stars 1.12k forks source link

class versioning recommendations/best practices #200

Open chrylis opened 9 years ago

chrylis commented 9 years ago

I'm running into issues where new class versions are changing serialVersionUIDs and throwing deserialization exceptions when a user with an existing session holding serialized data from an old class version tries to view a page. Are there any particular recommendations or best practices on how to handle incompatible serialization versions with Spring Session? Is there any manageable way to handle this in a Web application, such as at least saying "there was a problem" and explicitly expiring the session so the user can log back in?

pcornelissen commented 8 years ago

I think this is the same problem that is bugging me and others (see #320 for example). It should be solvable by #283, although you need to come up with a serializer on your own.

rwinch commented 8 years ago

@pcornelissen Spring Data Redis provides Jackson2JsonRedisSerializer. Does that help?