"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "hsqldb/src/org/hsqldb/Database.java" between
hsqldb-2.6.0.zip and hsqldb-2.6.1.zip

About: HSQLDB (HyperSQL DataBase) is a SQL relational database engine written in Java. It supports nearly full ANSI-92 SQL (BNF format) and full core SQL:2008.

Database.java  (hsqldb-2.6.0):Database.java  (hsqldb-2.6.1)
skipping to change at line 34 skipping to change at line 34
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
package org.hsqldb; package org.hsqldb;
import org.hsqldb.HsqlNameManager.HsqlName; import org.hsqldb.HsqlNameManager.HsqlName;
import org.hsqldb.Session.TimeoutManager;
import org.hsqldb.dbinfo.DatabaseInformation; import org.hsqldb.dbinfo.DatabaseInformation;
import org.hsqldb.error.Error; import org.hsqldb.error.Error;
import org.hsqldb.error.ErrorCode; import org.hsqldb.error.ErrorCode;
import org.hsqldb.lib.FrameworkLogger; import org.hsqldb.lib.FrameworkLogger;
import org.hsqldb.lib.HsqlArrayList; import org.hsqldb.lib.HsqlArrayList;
import org.hsqldb.lib.HsqlTimer; import org.hsqldb.lib.HsqlTimer;
import org.hsqldb.lib.OrderedHashMap; import org.hsqldb.lib.OrderedHashMap;
import org.hsqldb.map.ValuePool; import org.hsqldb.map.ValuePool;
import org.hsqldb.persist.HsqlDatabaseProperties; import org.hsqldb.persist.HsqlDatabaseProperties;
import org.hsqldb.persist.HsqlProperties; import org.hsqldb.persist.HsqlProperties;
skipping to change at line 62 skipping to change at line 63
// incorporates following contributions // incorporates following contributions
// campbell-burnet@users - javadoc comments // campbell-burnet@users - javadoc comments
/** /**
* Database is the root class for HSQL Database Engine database. <p> * Database is the root class for HSQL Database Engine database. <p>
* *
* It holds the data structures that form an HSQLDB database instance. * It holds the data structures that form an HSQLDB database instance.
* *
* @author Fred Toussi (fredt@users dot sourceforge.net) * @author Fred Toussi (fredt@users dot sourceforge.net)
* @version 2.6.0 * @version 2.6.1
* @since 1.9.0 * @since 1.9.0
*/ */
public class Database { public class Database {
int databaseID; int databaseID;
HsqlName databaseUniqueName; HsqlName databaseUniqueName;
DatabaseType databaseType; DatabaseType databaseType;
private final String canonicalPath; private final String canonicalPath;
public HsqlProperties urlProperties; public HsqlProperties urlProperties;
private final String path; private final String path;
skipping to change at line 117 skipping to change at line 118
public boolean sqlEnforceTDCU = true; public boolean sqlEnforceTDCU = true;
public boolean sqlIgnoreCase = false; public boolean sqlIgnoreCase = false;
public boolean sqlLiveObject = false; public boolean sqlLiveObject = false;
public boolean sqlLongvarIsLob = false; public boolean sqlLongvarIsLob = false;
public boolean sqlNullsFirst = true; public boolean sqlNullsFirst = true;
public boolean sqlNullsOrder = true; public boolean sqlNullsOrder = true;
public boolean sqlSysIndexNames = false; public boolean sqlSysIndexNames = false;
public boolean sqlRegularNames = true; public boolean sqlRegularNames = true;
public boolean sqlTranslateTTI = true; public boolean sqlTranslateTTI = true;
public boolean sqlUniqueNulls = true; public boolean sqlUniqueNulls = true;
public boolean sqlLowerCaseIdentifier = false;
public boolean sqlSyntaxDb2 = false; public boolean sqlSyntaxDb2 = false;
public boolean sqlSyntaxMss = false; public boolean sqlSyntaxMss = false;
public boolean sqlSyntaxMys = false; public boolean sqlSyntaxMys = false;
public boolean sqlSyntaxOra = false; public boolean sqlSyntaxOra = false;
public boolean sqlSyntaxPgs = false; public boolean sqlSyntaxPgs = false;
public int recoveryMode = 0; public int recoveryMode = 0;
private boolean isReferentialIntegrity = true; private boolean isReferentialIntegrity = true;
public HsqlDatabaseProperties databaseProperties; public HsqlDatabaseProperties databaseProperties;
private final boolean shutdownOnNoConnection; private final boolean shutdownOnNoConnection;
int resultMaxMemoryRows; int resultMaxMemoryRows;
skipping to change at line 564 skipping to change at line 566
} }
public void setIgnoreCase(boolean mode) { public void setIgnoreCase(boolean mode) {
sqlIgnoreCase = mode; sqlIgnoreCase = mode;
} }
public void setSysIndexNames(boolean mode) { public void setSysIndexNames(boolean mode) {
sqlSysIndexNames = mode; sqlSysIndexNames = mode;
} }
public void setLowerCaseIndentifer(boolean mode) {
this.sqlLowerCaseIdentifier = mode;
}
public void setSyntaxDb2(boolean mode) { public void setSyntaxDb2(boolean mode) {
sqlSyntaxDb2 = mode; sqlSyntaxDb2 = mode;
} }
public void setSyntaxMss(boolean mode) { public void setSyntaxMss(boolean mode) {
sqlSyntaxMss = mode; sqlSyntaxMss = mode;
} }
public void setSyntaxMys(boolean mode) { public void setSyntaxMys(boolean mode) {
sqlSyntaxMys = mode; sqlSyntaxMys = mode;
skipping to change at line 888 skipping to change at line 894
* Sessions running a statement with timeout are added to the list. The firs t * Sessions running a statement with timeout are added to the list. The firs t
* session starts the runner. Sessions are not removed until closed.<p> * session starts the runner. Sessions are not removed until closed.<p>
* *
* The runner is called at second intervals. It handles the countdown for * The runner is called at second intervals. It handles the countdown for
* each session currently running a statement with timeout. If timeout * each session currently running a statement with timeout. If timeout
* is reached, the runner aborts the statement.<p> * is reached, the runner aborts the statement.<p>
*/ */
static class TimeoutRunner implements Runnable { static class TimeoutRunner implements Runnable {
private Object timerTask; private Object timerTask;
private HsqlArrayList sessionList; private HsqlArrayList timeoutList;
int abortCount; int abortCount;
public void run() { public void run() {
try { try {
synchronized (this) { synchronized (this) {
for (int i = 0; i < sessionList.size(); i++) { for (int i = 0; i < timeoutList.size(); i++) {
Session session = (Session) sessionList.get(i); TimeoutManager timeOut =
(TimeoutManager) timeoutList.get(i);
if (session.isClosed()) { if (timeOut.isClosed()) {
sessionList.remove(i); timeoutList.remove(i);
i--; i--;
continue; continue;
} }
boolean result = session.timeoutManager.checkTimeout(); boolean result = timeOut.checkTimeout();
if (result) { if (result) {
abortCount++; abortCount++;
} }
} }
} }
} catch (Throwable e) { } catch (Throwable e) {
// ignore exceptions // ignore exceptions
// may be InterruptedException or IOException // may be InterruptedException or IOException
skipping to change at line 930 skipping to change at line 937
public void stop() { public void stop() {
synchronized (this) { synchronized (this) {
if (timerTask == null) { if (timerTask == null) {
return; return;
} }
HsqlTimer.cancel(timerTask); HsqlTimer.cancel(timerTask);
timerTask = null; timerTask = null;
sessionList = null; timeoutList = null;
} }
} }
public void addSession(Session session) { public void addSession(TimeoutManager timeout) {
synchronized (this) { synchronized (this) {
if (timerTask == null) { if (timerTask == null) {
start(); start();
} }
sessionList.add(session); timeoutList.add(timeout);
} }
} }
private void start() { private void start() {
sessionList = new HsqlArrayList(128); timeoutList = new HsqlArrayList();
timerTask = DatabaseManager.getTimer().schedulePeriodicallyAfter(0, timerTask =
DatabaseManager.getTimer().schedulePeriodicallyAfter(1000,
1000, this, true); 1000, this, true);
} }
} }
} }
 End of changes. 12 change blocks. 
12 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)