Class ConnectionKeeper

  extended by com.atlassian.jira.upgrade.ConnectionKeeper

public final class ConnectionKeeper
extends Object

This class is used to keep connections open to the database while JIRA is running. It is used with HSQLDB as HSQLDB, when running in-process, will shutdown as soon as no connections are open to it. When a new connection is opened to the HSQLDB it will start up again. However, this causes problems as more than one HSQLDB instance may be created at the same time and the two instances interfere wuth each other, possibly causing data loss.

As advised in the HSQLDB documentation, if HSQLDB is used in-process, a connection to it should be open at all times, to prevent the database from shutting down. One connections seems not to be good enough, though (probably due to a HSQLDB bug). Two connections does the trick.

Constructor Summary
ConnectionKeeper(String ofbizHelperName, int numberConnections, int sleepMillis)
Method Summary
 void shutdown()
 void start()
          Schedule the connection keeper.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ConnectionKeeper(String ofbizHelperName,
                        int numberConnections,
                        int sleepMillis)
Method Detail


public void start()
Schedule the connection keeper. This isn't done in a constructor because doing it in a constructor would mean passing a reference to ourselves to another thread before the constructor had finished constructing... this is bad practice.


public void shutdown()

Copyright © 2002-2014 Atlassian. All Rights Reserved.