jsr107 / jsr107spec

JSR107 Cache Specification
Apache License 2.0
413 stars 164 forks source link

New CDI scope SessionCacheScoped #414

Open beikov opened 3 years ago

beikov commented 3 years ago

Crossposting: https://github.com/eclipse-ee4j/cdi/issues/456

I would like to propose a new scope called @SessionCacheScoped with an optional cache name. The purpose of the scope is, that data is associated with a session without using the HttpSession as storage. I often associate some data that I loaded from the database with a user session and using @SessionScoped is usually fine, but in a clustered setup this becomes a problem due to session replication overhead. To avoid these issue, I would like to put the beans into a local cache instead which is associated with the session.

One might think that this kind of scope should be provided by JCache(JSR 107), but since it is not part of Jakarta EE (yet), I wanted to post it here and maybe start a discussion about the possible inclusion of the JCache API.

cruftex commented 3 years ago

I doubt that JSR107 will get part of Jakarta EE since its still based on Java 6. It needs a major touch up, which is probably a new standard. Is there any issue / discussion around this one could follow?

beikov commented 3 years ago

I don't think that there is a discussion about this yet, but maybe now is the right time to start talking about this. Jakarta EE 9 (which was mainly about the namespace switch from javax to jakarta) is almost finished and work on new features/specs seems to have started. I would love to see a Jakarta Cache specification roughly based on what JSR107 already produced!