Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Code migration from 9.3.x to 9.4.x

Not sure if you have seen the new session docs here:

source wise, might be quickest to take a look at the tests for jdbc sessions here:

that shows the creation, I think we might need to get some more embedded examples up in this area, will take a look at that


jesse mcconnell

On Wed, Feb 1, 2017 at 2:09 AM, Ivan Furnadjiev <ivan@xxxxxxxxxxxxxxxxx> wrote:
Hi all,
In RAP project we are using embedded Jetty for our cluster tests with sessions persistence in H2. Our implementation is based on the example shown in [1]. The code which we are using in Jetty 9.3.x is:
public SessionManager createSessionManager( Server server ) {
  JDBCSessionManager result = new JDBCSessionManager();
  result.setSaveInterval( SAVE_INTERVAL );
  return result;

public SessionIdManager createSessionIdManager( Server server ) {
  JDBCSessionIdManager result = new JDBCSessionIdManager( server );
  result.setScavengeInterval( SCAVENGE_INTERVAL );
  result.setWorkerName( generateNodeName() );
  Driver driver = databaseServer.getDriver();
  String connectionUrl = databaseServer.getConnectionUrl();
  result.setDriverInfo( driver, connectionUrl );
  return result;
What I understand from the migration guide is that in Jetty 9.4.x we don't have (JDBC)SessionManager anymore and the functionality is handled by SessionHandler. That's clear.
(JDBC)SessionIdManager is replaced by DefaultSessionIdManager. I have 3 questions:
1. What is the replacement of setSaveInterval?
2. To set scavenge interval I have to create HouseKeeper and set it on DefaultSessionIdManager. Right?
3. How to set the database driver info in session id manager?
Could you provide some code snippets that answer the questions above?

Thanks in advance,

jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top