Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Problem tablet/mobile and serversession(On every request serversession is recreated)
Problem tablet/mobile and serversession [message #1534839] Mon, 29 December 2014 10:26 Go to next message
Amel Jakupovic is currently offline Amel JakupovicFriend
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 Go to previous messageGo to next message
Amel Jakupovic is currently offline Amel JakupovicFriend
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... Smile


Re: Problem tablet/mobile and serversession [message #1536457 is a reply to message #1535707] Tue, 30 December 2014 08:03 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Amel Jakupovic wrote on Mon, 29 December 2014 22:52

Where I can change maxInactiveInterval in session ?


The maxInactiveInterval is defined on javax.servlet.http.HttpSession.
I am not an expert in this domain, but isn't it the responsability of the application server (jetty, tomcat or whatever) to set this interval?

Which Scout and which RAP version I you using?
You are mentioning a Git Repository, which branch have you checked?

.
Re: Problem tablet/mobile and serversession [message #1536551 is a reply to message #1536457] Tue, 30 December 2014 09:15 Go to previous messageGo to next message
Amel Jakupovic is currently offline Amel JakupovicFriend
Messages: 64
Registered: March 2010
Member
thanks Jeremie.

I put in config.ini:
### Development Equinox Server
org.eclipse.equinox.http.jetty.context.sessioninactiveinterval=36000

now everything is working.

We always use last versione from scout site. Without checking out anything from gIt.

this is site where I found method is changed: https://github.com/eclipse/scout.rt/blob/master/org.eclipse.scout.rt.server/src/org/eclipse/scout/rt/server/ServiceTunnelServlet.java

now we are use Eclipse Luna 4.4.1.
Scout/RAP 4.0.100.20140917-0958

thanks one more time
Re: Problem tablet/mobile and serversession [message #1536720 is a reply to message #1536551] Tue, 30 December 2014 11:31 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Amel Jakupovic wrote on Tue, 30 December 2014 10:15
Now everything is working.


Thanks for giving us feedback.

Amel Jakupovic wrote on Tue, 30 December 2014 10:15
We always use last versione from scout site. Without checking out anything from git.


I assume you know it already, but this give me opportunity to give you some links:

For the Git Repository:
We follow this pattern for our Branches

* develop: we work on the N-Release on this branch. The state of this branch is really experimental.

* "releases/4.3.x": we work on the M-Release (Mars) on this branch. The definitive version of Mars will be 5.0.0 (in June 2015). This means that we will create a new branch "releases/5.0.x" (branched from "releases/4.3.x") to finalize the mars version.

* master: we do not really use this branch. When a major release is out (for example Luna, we merge back the commits on this branch).

For the Update sites:
They are also listed on the wiki: Eclipse Scout Update Sites.

Depending on the version you want, you might need to use one of the update sites.

Re: Problem tablet/mobile and serversession [message #1537124 is a reply to message #1536720] Tue, 30 December 2014 16:57 Go to previous messageGo to next message
Amel Jakupovic is currently offline Amel JakupovicFriend
Messages: 64
Registered: March 2010
Member
Thanks Jeremie,

system that we are working on is in preproduction envirenment, and is going to production next month.

For now everything is working well and we will stay on master branch. If we find some problems we will inform community.

System 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.

Last 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 ? Smile

Thanks Jeremie
Re: Problem tablet/mobile and serversession [message #1538300 is a reply to message #1537124] Wed, 31 December 2014 08:42 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Amel Jakupovic wrote on Tue, 30 December 2014 17:57
System 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:57
Last 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 ? Smile


Sorry for the previous digression. Back on your question! I have answered it here: Eclipse BIRT & Eclipse Scout "SVG Field" integration.
Previous Topic:@ClassId and documentation usage
Next Topic:sql replace function for derby
Goto Forum:
  


Current Time: Fri Apr 26 04:06:13 GMT 2024

Powered by FUDForum. Page generated in 0.04867 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top