From a55f7a27f4fe799802aa6fd911e987a0e79b6fa4 Mon Sep 17 00:00:00 2001 From: mdb Date: Sat, 26 May 2001 04:49:31 +0000 Subject: [PATCH] ensureConnection() and shutdown() should be synchronized as they can be called by multiple threads and wouldn't cope well if they were. git-svn-id: https://samskivert.googlecode.com/svn/trunk@121 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../samskivert/src/java/com/samskivert/jdbc/Repository.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/jdbc/Repository.java b/projects/samskivert/src/java/com/samskivert/jdbc/Repository.java index 533a7f6e..66a2bf8b 100644 --- a/projects/samskivert/src/java/com/samskivert/jdbc/Repository.java +++ b/projects/samskivert/src/java/com/samskivert/jdbc/Repository.java @@ -1,5 +1,5 @@ // -// $Id: Repository.java,v 1.5 2001/05/26 03:22:25 mdb Exp $ +// $Id: Repository.java,v 1.6 2001/05/26 04:49:31 mdb Exp $ package com.samskivert.jdbc; @@ -66,7 +66,7 @@ public abstract class Repository } /** Establishes a connection to the database. */ - protected void ensureConnection () + protected synchronized void ensureConnection () throws SQLException { // nothing doing if we've already got a connection @@ -152,7 +152,7 @@ public abstract class Repository * it. This allows the repository to cleanly terminate the underlying * database services. */ - public void shutdown () + public synchronized void shutdown () throws SQLException { if (_session != null) {