Problem tablet/mobile and serversession [message #1534839] |
Mon, 29 December 2014 10:26 |
Amel Jakupovic Messages: 64 Registered: March 2010 |
Member |
|
|
Hi,
we are store bean in serversession, that is populate after login. But after login, every request to server recreate serversession.
We see that virtualsessionID is the same but in method:
private IServerSession lookupScoutServerSessionOnVirtualSession(HttpServletRequest req, HttpServletResponse res, String ajaxSessionId, Subject subject, UserAgent userAgent) throws ProcessingException, ServletException {
initializeAjaxSessionTimeout(req);
IServerSession serverSession = m_ajaxSessionCache.get(ajaxSessionId);
if (serverSession == null) {
synchronized (m_ajaxSessionCache) {
serverSession = m_ajaxSessionCache.get(ajaxSessionId);
if (serverSession == null) { // double checking
return createAndCacheNewServerSession(ajaxSessionId, subject, userAgent, req, res);
}
}
}
m_ajaxSessionCache.touch(ajaxSessionId);
return serverSession;
}
In m_ajaxSessionCache we have that ajaxSessionID, but in method get he call beforeAccessToInternalMap:
protected void beforeAccessToInternalMap() {
if (System.currentTimeMillis() > m_nextMaintenance) {
validateInternalMap();
m_nextMaintenance = System.currentTimeMillis() + m_sessionTimeoutMillis / 2;
}
}
protected boolean isEntryValid(DynamicEntry e) {
VirtualSessionEntry v = (VirtualSessionEntry) e;
return v.getTimestamp() + v.getInactivityTimeout() >= System.currentTimeMillis();
}
problem is in methode isEntryValid, it return false, and program remove entry from map. After that he recreate serverSession.
In swing and web everything is working.
We think that problem is in v.getInactivityTimeout it's always 3600....
thanks
|
|
|
Re: Problem tablet/mobile and serversession [message #1535707 is a reply to message #1534839] |
Mon, 29 December 2014 21:52 |
Amel Jakupovic Messages: 64 Registered: March 2010 |
Member |
|
|
In class: ServiceTunnelServlet we have methode
/**
* Initialize Ajax Session timeout only once from the HTTP session
*/
protected void initializeAjaxSessionTimeout(HttpServletRequest req) {
if (!m_isAjaxSessionTimeoutInitialized) {
final long defaultSessionTimeout = 3600L;
final long millisecondsInSeconds = 1000L;
m_ajaxSessionCache.setSessionTimeoutMillis(Math.max(defaultSessionTimeout, millisecondsInSeconds * req.getSession().getMaxInactiveInterval()));
m_isAjaxSessionTimeoutInitialized = true;
}
}
req.getSession().getMaxInactiveInterval() returns nothing ???? Does anyone know why ?
and m_ajaxSessionCache.setSessionTimeoutMillis(3600)
on GIT version of code the methode is change to:
private IServerSession lookupScoutServerSessionOnVirtualSession(HttpServletRequest req, HttpServletResponse res, String ajaxSessionId, Subject subject, UserAgent userAgent) throws ProcessingException, ServletException {
synchronized (m_ajaxSessionCache) {
//update session timeout
int maxInactive = req.getSession().getMaxInactiveInterval();
if (maxInactive < 0) {
maxInactive = 3600;
}
m_ajaxSessionCache.setSessionTimeoutMillis(Math.max(1000L, 1000L * maxInactive));
IServerSession serverSession = m_ajaxSessionCache.get(ajaxSessionId);
if (serverSession == null) {
serverSession = SERVICES.getService(IServerSessionRegistryService.class).newServerSession(m_serverSessionClass, subject, userAgent);
m_ajaxSessionCache.put(ajaxSessionId, serverSession);
}
else {
m_ajaxSessionCache.touch(ajaxSessionId);
}
return serverSession;
}
}
Where I can change maxInactiveInterval in session ?
thanks
p.s. sorry for bad english...
|
|
|
|
|
|
|
Re: Problem tablet/mobile and serversession [message #1538300 is a reply to message #1537124] |
Wed, 31 December 2014 08:42 |
Jeremie Bresson Messages: 1252 Registered: October 2011 |
Senior Member |
|
|
Amel Jakupovic wrote on Tue, 30 December 2014 17:57System that we are working on maybe will be interesting for show case. It's central system that use multi connection to 20 ms sql server + local postgres db.
YES it is!
We have noticed that we (as scout dev team) don't know the scout community very well. It was one of our findings during the first Scout User Group Meeting where we invited only scout users we already knew. Main feedback was to have something more open for the next iteration.
An other important point in the moment is to demonstrate that people are using eclipse scout to build applications (prototypes, small applications, big applications). The Eclipse community is not as much aware as we would like it. One of the reasons is that only our applications are used as show case. Scout users should say why they use the framework, what they like and how it could be improved.
In my opinion it will also help us in our own company: scout started as an internal company framework many years. We decided to open-source 4 years ago it and we are very happy with this move. Sadly not every of our co-worker see what we have achieve.
I would really appreciate if everyone on the forum would answer to our made with Scout Survey. This way we can identify you as someone who has invested (or is investing) on top of the Eclipse Scout Framework. Business applications are never sexy and they often look similar. The important point is: they help their users to do their job well and to work efficiently. This is how value is created, by solving the problems. This makes it hard to communicate about the Eclipse Scout Framework. The Gallery is a way to do it and I hope that the number of applications and screenshots will demonstrate the strength of scout. So yes, please take the survey. If this it simpler for you, just drop us an email at scout@bsiag.com.
As nice side effect we will have a closer relationship with you (communication, road-map sharing, invitation to events...) than what we have on this forum (almost an anonymous relationship).
Amel Jakupovic wrote on Tue, 30 December 2014 17:57Last problem that we have is integrating BIRT, for showing charts we want the use SVG, but have some problems the find manuals and examples.... maybe have some info about that ?
Sorry for the previous digression. Back on your question! I have answered it here: Eclipse BIRT & Eclipse Scout "SVG Field" integration.
|
|
|
Powered by
FUDForum. Page generated in 0.04867 seconds