Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

User session management during page update or new app deployment

Avatar

Level 2

Hi,

Can someone describe how CQ manages user session when for example user works with some cq page which related with another pages 

and in middle of his work process CQ page is updated by new publish, so user session can be spoiled by unexpected update, how CQ can

handle this case?

Also what about services, user works with page which all time use some OSGi service deployed on CQ publish, app deployment update this 

service bundle, what happens - page remain using old OSGI service or switching to newly deployed version?

I can't find this information in google, please help by describing or pointing to proper doc resources 

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

First of all, the recommended way to develop AEM projects is to avoid server-side (HTTP) sessions. These impact performance (caching) and operations, and are generally considered bad style when you work with an resource-based framework like Sling.

In the AEM world the word "session" can also mean "JCR sessions" (which should be abstracted away in most cases by the Sling ResourceResolver). These sessions are recommended to live as short as possible, the normal style is to create a session per request (which is already done by the sling framework for you). If you need to access the JCR repository also in OSGI services, it is up to you, the general recommendation "short-lived sessions" holds true here as well.

So can you clarify a bit, in which aspects of "sessions" you are interested in?

kind regards,
Jörg

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi,

First of all, the recommended way to develop AEM projects is to avoid server-side (HTTP) sessions. These impact performance (caching) and operations, and are generally considered bad style when you work with an resource-based framework like Sling.

In the AEM world the word "session" can also mean "JCR sessions" (which should be abstracted away in most cases by the Sling ResourceResolver). These sessions are recommended to live as short as possible, the normal style is to create a session per request (which is already done by the sling framework for you). If you need to access the JCR repository also in OSGI services, it is up to you, the general recommendation "short-lived sessions" holds true here as well.

So can you clarify a bit, in which aspects of "sessions" you are interested in?

kind regards,
Jörg

Avatar

Level 2

I actually mean not session but user experience with working on CQ pages, I don't know if it can be managed over session, I just want to have my user not spoiled in the middle of his unit of work with CQ site when some update of page he can visit done and it can affect him unexpectedly 

I have idea of versioning over JCR+Dispatcher when user session works with constant version of pages from CQ pages until user session is finished. New login will direct users to new pages published and latest version, it will give possibility update Live environment with new pages safely. I thought it was counted in CQ because it quite trivial case, but docs are poor