public Session getSession(boolean create) {
// we must assure a 1:1-mapping of server session to cocoon session
javax.servlet.http.HttpSession serverSession = this.req.getSession(create);
if (serverSession != null) {
synchronized (serverSession) {
// retrieve existing wrapper
this.session =
(HttpSession)serverSession.getAttribute(HTTP_SESSION);
if (this.session == null) {
// create wrapper
this.session = new HttpSession(serverSession);
serverSession.setAttribute(HTTP_SESSION, this.session);
}
}
} else {
// invalidate
this.session = null;
}
return this.session;
}
It suddenly dawned on me that the code below is synchronizing on the
session, not a local object. Duh! Still, this seems like a very, very
bad idea to me, as I'm not sure how that would impact the servlet container.
- Re: Re: [IMP] synchronization on session object in Coco... Joerg Heinicke
- Re: [IMP] synchronization on session object in Cocoon Joerg Heinicke
- Re: [IMP] synchronization on session object in Cocoo... Sylvain Wallez
- Re: [IMP] synchronization on session object in C... Joerg Heinicke
- RE: Re: [IMP] synchronization on session object in Cocoo... Nathaniel Alfred
- RE: [IMP] synchronization on session object in Cocoon Nathaniel Alfred
- Re: [IMP] synchronization on session object in Cocoo... Sylvain Wallez
- Re: [IMP] synchronization on session object in C... Joerg Heinicke
- Re: [IMP] synchronization on session object ... Sylvain Wallez
- Re: [IMP] synchronization on session obj... Joerg Heinicke
- Re: [IMP] synchronization on session object in Cocoon Ralph Goers
- Re: [IMP] synchronization on session object in Cocoon Ralph Goers
- Re: [IMP] synchronization on session object in Cocoo... Joerg Heinicke
- RE: Re: [IMP] synchronization on session object in Cocoo... Nathaniel Alfred
- Re: Re: [IMP] synchronization on session object in ... Joerg Heinicke
- Re: [IMP] synchronization on session object in Cocoo... Ralph Goers
- Re: [IMP] synchronization on session object in Cocoo... Ralph Goers
- Re: [IMP] synchronization on session object in C... Jochen Kuhnle
- Re: [IMP] synchronization on session object ... Ralph Goers
- Re: [IMP] synchronization on session obj... Joerg Heinicke
- Re: [IMP] synchronization on session object ... Ralph Goers
