X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Fserver%2Fsession%2FJDBCSessionIdManager.java;h=b5fedd26de72881e992c7935e482a1261394c783;hp=4c7227d7717a5323b5e30cf21c8479855458c48d;hb=ba4f228fa9f72d50991a2218cfd83987ef5d385e;hpb=875b5e9651498a0cd8e0001c0742ba843e47cad0;ds=sidebyside diff --git a/lib/jetty/org/eclipse/jetty/server/session/JDBCSessionIdManager.java b/lib/jetty/org/eclipse/jetty/server/session/JDBCSessionIdManager.java index 4c7227d7..b5fedd26 100644 --- a/lib/jetty/org/eclipse/jetty/server/session/JDBCSessionIdManager.java +++ b/lib/jetty/org/eclipse/jetty/server/session/JDBCSessionIdManager.java @@ -1,6 +1,6 @@ // // ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. +// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd. // ------------------------------------------------------------------------ // All rights reserved. This program and the accompanying materials // are made available under the terms of the Eclipse Public License v1.0 @@ -297,7 +297,11 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager if (_dbAdaptor == null) throw new IllegalStateException ("No DBAdaptor"); String longType = _dbAdaptor.getLongType(); - return "alter table "+getTableName()+" add "+getMaxIntervalColumn()+" "+longType+" not null default "+MAX_INTERVAL_NOT_SET; + String stem = "alter table "+getTableName()+" add "+getMaxIntervalColumn()+" "+longType; + if (_dbAdaptor.getDBName().contains("oracle")) + return stem + " default "+ MAX_INTERVAL_NOT_SET + " not null"; + else + return stem +" not null default "+ MAX_INTERVAL_NOT_SET; } private void checkNotNull(String s) @@ -477,7 +481,8 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager throws SQLException { _dbName = dbMeta.getDatabaseProductName().toLowerCase(Locale.ENGLISH); - LOG.debug ("Using database {}",_dbName); + if (LOG.isDebugEnabled()) + LOG.debug ("Using database {}",_dbName); _isLower = dbMeta.storesLowerCaseIdentifiers(); _isUpper = dbMeta.storesUpperCaseIdentifiers(); } @@ -603,7 +608,7 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager finally { if (_scheduler != null && _scheduler.isRunning()) - _scheduler.schedule(this, _scavengeIntervalMs, TimeUnit.MILLISECONDS); + _task = _scheduler.schedule(this, _scavengeIntervalMs, TimeUnit.MILLISECONDS); } } } @@ -777,10 +782,10 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager if (LOG.isDebugEnabled()) LOG.debug("Scavenging every "+_scavengeIntervalMs+" ms"); - //if (_timer!=null && (period!=old_period || _task==null)) - if (_scheduler != null && (period!=old_period || _task==null)) + synchronized (this) { - synchronized (this) + //if (_timer!=null && (period!=old_period || _task==null)) + if (_scheduler != null && (period!=old_period || _task==null)) { if (_task!=null) _task.cancel(); @@ -991,6 +996,8 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager _ownScheduler = true; _scheduler.start(); } + else if (!_scheduler.isStarted()) + throw new IllegalStateException("Shared scheduler not started"); setScavengeInterval(getScavengeInterval()); }