public final class

ConnectionKeeper

extends Object
java.lang.Object
   ↳ com.atlassian.jira.upgrade.ConnectionKeeper

Class Overview

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.

Summary

Public Constructors
ConnectionKeeper(String ofbizHelperName, int numberConnections, int sleepMillis)
Public Methods
synchronized void shutdown()
synchronized void start()
Schedule the connection keeper.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

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

Public Methods

public synchronized void shutdown ()

public synchronized 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.