Index: src/edu/ucsb/nceas/shared/AccessException.java
===================================================================
--- src/edu/ucsb/nceas/shared/AccessException.java	(revision 5014)
+++ src/edu/ucsb/nceas/shared/AccessException.java	(nonexistent)
@@ -1,50 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: An Exception thrown when an error occurs because an 
- *             AccessionNumber was invalid or used incorrectly
- *  Copyright: 2008 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Michael Daigle
- *
- *   '$Author: daigle $'
- *     '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
- * '$Revision: 4080 $'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.shared;
-
-/**
- * Exception thrown when an error occurs in a configuration administrative
- * class
- */
-public class AccessException extends BaseException {
-	
-	private static final long serialVersionUID = -8436697355629175917L;
-
-	/**
-	 * Create a new AccessException.
-	 *
-	 * @param message The error or warning message.
-	 */
-	public AccessException(String message) {
-		super(message);
-	}
-	
-	public AccessException(String message, BaseException deeperException) {
-		super(message, deeperException);
-	}
-}

Property changes on: src/edu/ucsb/nceas/shared/AccessException.java
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: src/edu/ucsb/nceas/shared/BaseDAO.java
===================================================================
--- src/edu/ucsb/nceas/shared/BaseDAO.java	(revision 5014)
+++ src/edu/ucsb/nceas/shared/BaseDAO.java	(nonexistent)
@@ -1,70 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: A Class that holds the data from the scheduled_task 
- *             table in the database. 
- *  Copyright: 2009 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Michael Daigle
- * 
- *   '$Author: daigle $'
- *     '$Date: 2009-03-23 13:56:56 -0800 (Mon, 23 Mar 2009) $'
- * '$Revision: 4854 $'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-package edu.ucsb.nceas.shared;
-
-import java.sql.Timestamp;
-
-public class BaseDAO {
-	
-	private Long _id;
-	private Timestamp _createTime;
-	private Timestamp _modTime;
-	private String _status;
-	
-	public Long getId() {
-		return _id;
-	}
-	
-	public void setId(Long id) {
-		_id = id;
-	}
-	
-	public Timestamp getCreateTime() {
-		return _createTime;
-	}
-	
-	public void setCreateTime(Timestamp createTime) {
-		_createTime = createTime;
-	}
-	
-	public Timestamp getModTime() {
-		return _modTime;
-	}
-	
-	public void setModTime(Timestamp modTime) {
-		_modTime = modTime;
-	}
-	
-	public String getStatus() {
-		return _status;
-	}
-	
-	public void setStatus(String status) {
-		_status = status;
-	}
-	
-}
\ No newline at end of file
Index: src/edu/ucsb/nceas/shared/BaseAccess.java
===================================================================
--- src/edu/ucsb/nceas/shared/BaseAccess.java	(revision 5014)
+++ src/edu/ucsb/nceas/shared/BaseAccess.java	(nonexistent)
@@ -1,55 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: A Class that manages database access 
- *             information.
- *  Copyright: 2009 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Michael Daigle
- * 
- *   '$Author: daigle $'
- *     '$Date: 2009-03-23 13:56:56 -0800 (Mon, 23 Mar 2009) $'
- * '$Revision: 4854 $'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.shared;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import edu.ucsb.nceas.metacat.DBConnection;
-import edu.ucsb.nceas.metacat.DBConnectionPool;
-
-public abstract class BaseAccess {
-	
-	protected DBConnection conn = null;
-    protected int serialNumber = -1;
-    protected ResultSet rs = null;
-	
-    protected BaseAccess(String methodName) throws AccessException {
-        //check out DBConnection
-    	try {
-    		conn = DBConnectionPool.
-                	getDBConnection("methodName");
-    		serialNumber = conn.getCheckOutSerialNumber();
-    	} catch (SQLException sqle) {
-    		throw new AccessException("Could not get connection from DB connection pool: " 
-    				+ sqle.getMessage());
-    	}
-    }
-    
-    protected abstract BaseDAO populateDAO(ResultSet resultSet) throws SQLException ;
-}
\ No newline at end of file
Index: src/edu/ucsb/nceas/shared/BaseException.java
===================================================================
--- src/edu/ucsb/nceas/shared/BaseException.java	(revision 5014)
+++ src/edu/ucsb/nceas/shared/BaseException.java	(nonexistent)
@@ -1,71 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: An Exception thrown when an error occurs because an 
- *             AccessionNumber was invalid or used incorrectly
- *  Copyright: 2008 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Michael Daigle
- *
- *   '$Author: daigle $'
- *     '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
- * '$Revision: 4080 $'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.shared;
-
-/**
- * Exception thrown when an error occurs in a configuration administrative
- * class
- */
-public class BaseException extends Exception {
-
-
-	private static final long serialVersionUID = 1331212806605660813L;
-	
-	private static String _coreMessage;
-	
-	/**
-	 * Create a new AccessException.
-	 *
-	 * @param message The error or warning message.
-	 */
-	public BaseException(String message) {
-		super(message);
-		_coreMessage = message;
-	}
-	
-	/**
-	 * Create a new BaseException.
-	 *
-	 * @param message The error or warning message.
-	 */
-	public BaseException(String message, BaseException deeperException) {
-		super(message + " --> " + deeperException.getMessage());
-		_coreMessage = deeperException.getCoreMessage();
-	}
-	
-	public String getCoreMessage() {
-		return _coreMessage;
-	}
-	
-	public void setCoreMessage(String coreMessage) {
-		_coreMessage = coreMessage;
-	}
-	
-
-
-}

Property changes on: src/edu/ucsb/nceas/shared/BaseException.java
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: src/edu/ucsb/nceas/metacat/DBConnectionPool.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBConnectionPool.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBConnectionPool.java	(nonexistent)
@@ -1,798 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: A class represent a DBConnection pool. Another user can use the
- *    object to initial a connection pool, get db connection or return it. 
- *  Copyright: 2000 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Jing Tao
- *
- *   '$Author$'
- *     '$Date$'
- * '$Revision$'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.metacat;
-
-import java.io.*;
-import java.util.Vector;
-import java.lang.*;
-import java.sql.*;
-import java.util.Stack;
-import java.util.Hashtable;
-import java.util.Enumeration;
-
-import org.apache.log4j.Logger;
-
-import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.utilities.PropertyNotFoundException;
-
-/** 
- * A class represent a DBConnection pool. Another user can use the
- * object to initial a connection pool, get db connection or return it.
- * This a singleton class, this means only one instance of this class could
- * be in the program at one time. 
- */
-public class DBConnectionPool implements Runnable
-{
-
-  //static attributes
-  private static DBConnectionPool instance;
-  private static Vector connectionPool;
-  private static Thread runner;
-  private static int countOfReachMaximum = 0;
-  private static Logger logMetacat = Logger.getLogger(DBConnectionPool.class);
-
-  private static int maxConnNum;
-  private static int initConnNum;
-  private static int incrConnNum;
-  private static long maxAge;
-  private static long maxConnTime;
-  private static int maxUsageNum;
-  private static String dbConnRecyclThrd;
-  private static long cyclTimeDbConn;
-  
-  final static int MAXIMUMCONNECTIONNUMBER;
-  final static int INITIALCONNECTIONNUMBER;
-  final static int INCREASECONNECTIONNUMBER;
-  final static long MAXIMUMAGE;
-  final static long MAXIMUMCONNECTIONTIME;
-  final static int MAXIMUMUSAGENUMBER;
-  final static String DBCONNECTIONRECYCLETHREAD ;
-  final static long CYCLETIMEOFDBCONNECTION;
-  
-  static {
-		int maxConnNum = 0;
-		int initConnNum = 0;
-		int incrConnNum = 0;
-		long maxAge = 0;
-		long maxConnTime = 0;
-		int maxUsageNum = 0;
-		String dbConnRecyclThrd = null;
-		long cyclTimeDbConn = 0;
-		
-		try {
-			// maximum connection number in the connection pool
-			maxConnNum = Integer.parseInt(PropertyService
-					.getProperty("database.maximumConnections"));
-			initConnNum = Integer.parseInt(PropertyService
-					.getProperty("database.initialConnections"));
-			incrConnNum = Integer.parseInt(PropertyService
-					.getProperty("database.incrementConnections"));
-			maxAge = Integer.parseInt(PropertyService
-					.getProperty("database.maximumConnectionAge"));
-			maxConnTime = Long.parseLong(PropertyService
-					.getProperty("database.maximumConnectionTime"));
-			maxUsageNum = Integer.parseInt(PropertyService
-					.getProperty("database.maximumUsageNumber"));
-			dbConnRecyclThrd = PropertyService
-					.getProperty("database.runDBConnectionRecycleThread");
-			cyclTimeDbConn = Long.parseLong(PropertyService
-					.getProperty("database.cycleTimeOfDBConnection"));
-		} catch (PropertyNotFoundException pnfe) {
-			System.err.println("Could not get property in static block: "
-					+ pnfe.getMessage());
-		}
-		
-		MAXIMUMCONNECTIONNUMBER = maxConnNum;
-		INITIALCONNECTIONNUMBER = initConnNum;
-		INCREASECONNECTIONNUMBER = incrConnNum;
-		MAXIMUMAGE = maxAge;
-		MAXIMUMCONNECTIONTIME = maxConnTime;
-		MAXIMUMUSAGENUMBER = maxUsageNum;
-		DBCONNECTIONRECYCLETHREAD  = dbConnRecyclThrd;
-		CYCLETIMEOFDBCONNECTION = cyclTimeDbConn;
-	}
-  
-  // the number for trying to check out a connection in the pool in
-  // getDBConnection method
-  final static int LIMIT = 2;
-  
-  final static int FREE = 0; //status of a connection
-  final static int BUSY = 1; //statis of a connection
-  /**
-   * Returns the single instance, creating one if it's the
-   * first time this method is called.
-   */
-  public static synchronized DBConnectionPool getInstance()
-                                 throws SQLException 
-  {
-    if (instance == null) {
-      instance = new DBConnectionPool();
-      Logger log = Logger.getLogger(DBConnectionPool.class);
-      log.debug("MaximumConnectionNumber: "+MAXIMUMCONNECTIONNUMBER);
-      log.debug("Intial connection number: "+INITIALCONNECTIONNUMBER);
-      log.debug("Increated connection Number: "+INCREASECONNECTIONNUMBER);
-      log.debug("Maximum connection age: "+MAXIMUMAGE);
-      log.debug("Maximum connection time: "+MAXIMUMCONNECTIONTIME);
-      log.debug("Maximum usage count: "+MAXIMUMUSAGENUMBER);
-      log.debug("Running recycle thread or not: "+DBCONNECTIONRECYCLETHREAD);
-      log.debug("Cycle time of recycle: "+CYCLETIMEOFDBCONNECTION); 
-    }
-    return instance;
-  }
-
-
-  /**
-   * This is a private constructor since it is singleton
-   */
-   
-  private DBConnectionPool()  throws SQLException 
-  {
-    connectionPool = new Vector();
-    initialDBConnectionPool();
-    //running the thread to recycle DBConnection
-    if (DBCONNECTIONRECYCLETHREAD.equals("on"))
-    {
-      runner = new Thread(this);
-      runner.start();
-    }
-  }//DBConnection
-
-  /**
-   * Method to get the size of DBConnectionPool
-   */
-  public int getSizeOfDBConnectionPool()
-  {
-    return connectionPool.size();
-  }
-  
-  
-  /**
-   * Method to initial a pool of DBConnection objects 
-   */
-  private void initialDBConnectionPool() throws SQLException 
-  {
-
-    DBConnection dbConn = null;
-    
-    for ( int i = 0; i < INITIALCONNECTIONNUMBER; i++ ) 
-    {
-      //create a new object of DBConnection
-      //this DBConnection object has a new connection in it
-      //it automatically generate the createtime and tag
-      dbConn = new DBConnection();
-      //put DBConnection into vetor
-      connectionPool.add(dbConn);
-    }    
-    
-  
-  }//initialDBConnectionPool
-  
-  /**
-   * Method to get Connection object (Not DBConnection)
-   */
-  /*public static Connection getConnection() throws SQLException
-  {
-    DBConnection dbConn = null;
-    //get a DBConnection
-    dbConn = getDBConnection();
-    //get connection object in DBConnection object
-    //The following getConnections method is in DBConnection class
-    return dbConn.getConnections();
-  }*/
-  
- 
-  /**
-   * Method to get a DBConnection in connection pool
-   * 1) try to get a DBConnection from DBConnection pool
-   * 2) if 1) failed, then check the size of pool. If the size reach the
-   *    maximum number of connection, throw a exception: couldn't get one
-   * 3) If the size is less than the maximum number of connectio, create some
-   *    new connections and recursive get one
-   * @param methodName, the name of method which will check connection out
-   */
-  public static synchronized DBConnection getDBConnection(String methodName) 
-                                                throws SQLException
-  {
-    if (instance == null) {
-      instance = DBConnectionPool.getInstance();
-    }
-    DBConnection db = null;
-    int random = 0; //random number
-    int index = 0; //index
-    int size = 0; //size of connection pool
-    logMetacat.debug("Try to checking out connection...");
-    size = connectionPool.size();
-    logMetacat.debug("size of connection pool: "+size);
-    
-     //try every DBConnection in the pool
-    //every DBConnection will be try LIMITE times
-    for (int j=0 ; j<LIMIT; j++)
-    {
-       //create a random number as the started index for connection pool
-      //So that the connection ofindex of 0 wouldn't be a the heaviest user
-      random = (new Double (Math.random()*100)).intValue();
-      for (int i=0; i<size; i++)
-      {
-        index =(i+random)%size;
-        db = (DBConnection) connectionPool.elementAt(index);
-        logMetacat.debug("Index: "+index);
-        logMetacat.debug("Tag: "+db.getTag());
-        logMetacat.debug("Status: "+db.getStatus());
-        //check if the connection is free
-        if (db.getStatus()==FREE)
-        {
-          //If this connection is good, return this DBConnection
-          if (validateDBConnection(db))
-          {
-            
-            //set this DBConnection status
-            db.setStatus(BUSY);
-            //increase checkout serial number
-            db.increaseCheckOutSerialNumber(1);
-            //increase one usageCount
-            db.increaseUsageCount(1);
-            //set method name to DBConnection
-            db.setCheckOutMethodName(methodName);
-            db.setAutoCommit(true);
-            //debug message
-            logMetacat.debug("The connection is checked out: "
-                                       +db.getTag());
-            logMetacat.debug("The method for checking is: " 
-                                              +db.getCheckOutMethodName());
-            logMetacat.debug("The age is "+db.getAge());
-            logMetacat.debug("The usage is "+db.getUsageCount());
-            logMetacat.debug("The conection time it has: "
-                                                +db.getConnectionTime());
-            //set check out time
-            db.setCheckOutTime(System.currentTimeMillis());
-            // set count of reach maximum 0 because it can check out
-            countOfReachMaximum =0;
-            return db;
-          }//if
-          else//The DBConnection has some problem
-          {
-            //close this DBConnection
-            db.close();
-            //remove it form connection pool
-            connectionPool.remove(index);
-            //insert a new DBConnection to same palace
-            db = new DBConnection();
-            connectionPool.insertElementAt(db, index);
-          }//else
-        }//if
-      }//for
-    }//for
-    
-    //if couldn't get a connection, we should increase DBConnection pool
-    //if the connection pool size is less than maximum connection number
-   
-    if ( size < MAXIMUMCONNECTIONNUMBER )
-    {
-       if ((size+INCREASECONNECTIONNUMBER) < MAXIMUMCONNECTIONNUMBER)
-       { 
-         //if we can create INCREASECONNECTIONNUMBER of new DBConnection
-         //add to connection pool
-         for ( int i=0; i<INCREASECONNECTIONNUMBER; i++)
-         {
-           DBConnection dbConn = new DBConnection();
-           connectionPool.add(dbConn);
-         }//for
-       }//if
-       else
-       {
-         //There is no enough room to increase INCREASECONNECTIONNUMBER 
-         //we create new DBCoonection to Maximum connection number
-         for (int i= size+1; i<= MAXIMUMCONNECTIONNUMBER; i++)
-         {
-           DBConnection dbConn = new DBConnection();
-           connectionPool.add(dbConn);
-         }//for
-       }//else
-   
-    }//if
-    else
-    {
-      /*throw new SQLException("The maximum of " +MAXIMUMCONNECTIONNUMBER + 
-                            " open db connections is reached." +
-                            " New db connection to MetaCat" +
-                            " cannot be established.");*/
-       logMetacat.fatal("The maximum of " +MAXIMUMCONNECTIONNUMBER + 
-                            " open db connections is reached." +
-                            " New db connection to MetaCat" +
-                            " cannot be established.");
-       countOfReachMaximum ++;
-       if (countOfReachMaximum >= 10)
-       {
-         countOfReachMaximum =0;
-         logMetacat.fatal("finally could not get dbconnection");
-         return null;
-       }
-       else
-       {
-         //if couldn't get a connection, sleep 20 seconds and try again.
-         try
-         {
-           logMetacat.info("sleep for could not get dbconnection");
-           Thread.sleep(5000);
-         }
-         catch (Exception e)
-        {
-           logMetacat.error("Exception in getDBConnection" + e.getMessage());
-        }
-      }
-         
-      
-    }//else
-    
-    //recursive to get new connection    
-    return getDBConnection(methodName); 
-  }//getDBConnection
-
- 
-  
-  
-  /** 
-   * Method to check if a db connection works fine or not
-   * Check points include:
-   * 1. check the usageCount if it is too many
-   * 2. check the dbconne age if it is too old
-   * 3. check the connection time if it is too long
-   * 4. run simple sql query
-   *
-   * @param dbConn, the DBConnection object need to check
-   */
-  private static boolean validateDBConnection (DBConnection dbConn)
-  {
-    
-    
-    //Check if the DBConnection usageCount if it is too many
-    if (dbConn.getUsageCount() >= MAXIMUMUSAGENUMBER )
-    {
-      logMetacat.debug("Connection usageCount is too many: "+
-      dbConn.getUsageCount());
-      return false;
-    }
-    
-    //Check if the DBConnection has too much connection time
-    if (dbConn.getConnectionTime() >= MAXIMUMCONNECTIONTIME)
-    {
-      logMetacat.debug("Connection has too much connection time: "+
-      dbConn.getConnectionTime());
-      return false;
-    }
-    
-    //Check if the DBConnection is too old
-    if (dbConn.getAge() >=MAXIMUMAGE)
-    {
-      logMetacat.debug("Connection is too old: "+dbConn.getAge());
-      return false;
-    }
-    
-    //Try to run a simple query
-    try
-    {
-      long startTime=System.currentTimeMillis();
-      DatabaseMetaData metaData = dbConn.getMetaData();
-      long stopTime=System.currentTimeMillis();
-      //increase one usagecount
-      dbConn.increaseUsageCount(1);
-      //increase connection time
-      dbConn.setConnectionTime(stopTime-startTime);
-  
-    }
-    catch (Exception e)
-    {
-      logMetacat.error("Error in validateDBConnection: "
-                                +e.getMessage());
-      return false;
-    }
-    
-    return true;
-    
-  }//validateDBConnection()
-  
-  /**
-   * Method to return a connection to DBConnection pool.
-   * @param conn, the Connection object need to check in
-   */
-  public static synchronized void returnDBConnection(DBConnection conn, 
-                                                              int serialNumber)
-  {
-    int index = -1;
-    DBConnection dbConn = null;
-  
-    index = getIndexOfPoolForConnection(conn);
-    if ( index ==-1 )
-    {
-      logMetacat.info("Couldn't find a DBConnection in the pool"
-                                  +" which have same tag to the returned"
-                                  +" DBConnetion object");
-      return;
-                                  
-    }//if
-    else
-    {
-      //check the paramter - serialNumber which will be keep in calling method
-      //if it is as same as the object's checkoutserial number.
-      //if it is same return it. If it is not same, maybe the connection already
-      // was returned ealier.
-      logMetacat.debug("serial number in Connection: "
-                                      +conn.getCheckOutSerialNumber());
-      logMetacat.debug("serial number in local: "+serialNumber);
-      if (conn.getCheckOutSerialNumber() == serialNumber)
-      {
-        dbConn = (DBConnection) connectionPool.elementAt(index);
-        //set status to free
-        dbConn.setStatus(FREE);
-        //count connection time
-        dbConn.setConnectionTime
-                          (System.currentTimeMillis()-dbConn.getCheckOutTime());
-                          
-        //set check out time to 0
-        dbConn.setCheckOutTime(0);
-        
-        logMetacat.debug("Connection: "+dbConn.getTag()+" checked in.");
-        logMetacat.debug("Connection: "+dbConn.getTag()+"'s status: "
-                                                    +dbConn.getStatus());
-                                                                       
-      }//if
-      else
-      {
-        logMetacat.info("This DBConnection couldn't return");
-      }//else
-    }//else
-   
- 
-  }//returnConnection
-  
-  /**
-   * Given a returned DBConnection, try to find the index of DBConnection object
-   * in dbConnection pool by comparing DBConnection' tag and conn.toString.
-   * If couldn't find , -1 will be returned.
-   * @param conn, the connection need to be found
-   */
-  private static synchronized int getIndexOfPoolForConnection(DBConnection conn)
-  {
-    int index = -1;
-    String info = null;
-    //if conn is null return -1 too
-    if (conn==null)
-    {
-      return -1;
-    }
-    //get tag of this returned DBConnection
-    info = conn.getTag();
-    //if the tag is null or empty, -1 will be returned
-    if (info==null || info.equals(""))
-    {
-      return index;
-    }
-    //compare this info to the tag of every DBConnection in the pool
-    for ( int i=0; i< connectionPool.size(); i++)
-    {
-      DBConnection dbConn = (DBConnection) connectionPool.elementAt(i);
-      if (info.equals(dbConn.getTag()))
-      {
-        index = i;
-        break;
-      }//if
-    }//for
-    
-    return index;
-  }//getIndexOfPoolForConnection  
-  
-  /**
-   * Method to shut down all connections
-   */
-  public static void release()
-  {
-    
-    //shut down the backgroud recycle thread
-    if (DBCONNECTIONRECYCLETHREAD.equals("on"))
-    {
-      runner.interrupt();
-    }
-    //cose every dbconnection in the pool
-    synchronized(connectionPool)
-    {
-      for (int i=0;i<connectionPool.size();i++)
-      {
-        try
-        {
-          DBConnection dbConn= (DBConnection) connectionPool.elementAt(i);
-          dbConn.close();
-        }//try
-        catch (SQLException e)
-        {
-          logMetacat.error("Error in release connection: "
-                                            +e.getMessage());
-        }//catch
-      }//for
-    }//synchronized
-  }//release()
-  
-  /**
-   * periodically to recycle the connection
-   */
-  public void run()
-  {
-    DBConnection dbConn = null;
-    //keep the thread running
-    while (true)
-    {
-      //check every dbconnection in the pool
-      synchronized(connectionPool)
-      {
-        for (int i=0; i<connectionPool.size(); i++)
-        {
-          dbConn = (DBConnection) connectionPool.elementAt(i);
-          
-          //if a DBConnection conncectioning time for one check out is greater 
-          //than 30000 milliseconds print it out
-          if (dbConn.getStatus()==BUSY && 
-            (System.currentTimeMillis()-dbConn.getCheckOutTime())>=30000)
-          {
-            logMetacat.fatal("This DBConnection is checked out for: "
-            +(System.currentTimeMillis()-dbConn.getCheckOutTime())/1000
-            +" secs");
-            logMetacat.fatal(dbConn.getTag());
-            logMetacat.error("method: "
-                                          +dbConn.getCheckOutMethodName());
-            
-          }
-          
-          //check the validation of free connection in the pool
-          if (dbConn.getStatus() == FREE)
-          {
-            try
-            {
-              //try to print out the warning message for every connection
-              if (dbConn.getWarningMessage()!=null)
-              {
-                logMetacat.warn("Warning for connection "
-                  +dbConn.getTag()+" : "+ dbConn.getWarningMessage());
-              }
-              //check if it is valiate, if not create new one and replace old one
-              if (!validateDBConnection(dbConn))
-              {
-                logMetacat.debug("Recyle it: "+ dbConn.getTag());
-                //close this DBConnection
-                dbConn.close();
-                //remove it form connection pool
-                connectionPool.remove(i);
-                //insert a new DBConnection to same palace
-                dbConn = new DBConnection();
-                connectionPool.insertElementAt(dbConn, i);
-               }//if
-            }//try
-            catch (SQLException e)
-            {
-              logMetacat.error("Error in DBConnectionPool.run: "
-                                              +e.getMessage());
-            }//catch
-          }//if
-        }//for
-      }//synchronize   
-      //Thread sleep 
-      try
-      {
-        Thread.sleep(CYCLETIMEOFDBCONNECTION);
-      }
-      catch (Exception e)
-      {
-        logMetacat.error("Error in DBConnectionPool.run: "
-                                              +e.getMessage());
-      }
-    }//while
-  }//run
-  
-  /**
-   * Method to get the number of free DBConnection in DBConnection pool
-   */
-  public static synchronized int getFreeDBConnectionNumber()
-  {
-    int numberOfFreeDBConnetion = 0; //return number
-    DBConnection db = null; //single DBconnection
-    int poolSize = 0; //size of connection pool
-    //get the size of DBConnection pool
-    poolSize = connectionPool.size();
-    //Check every DBConnection in the pool
-    for ( int i=0; i<poolSize; i++)
-    {
-      
-      db = (DBConnection) connectionPool.elementAt(i);
-      //check the status of db. If it is free, count it
-      if (db.getStatus() == FREE)
-      {
-        numberOfFreeDBConnetion++;
-      }//if
-    }//for
-    //return the count result
-    return numberOfFreeDBConnetion;
-  }//getFreeDBConnectionNumber
-      
-   /**
-   * Method to print out the method name which have busy DBconnection
-   */
-  public void printMethodNameHavingBusyDBConnection()
-  {
-    
-    DBConnection db = null; //single DBconnection
-    int poolSize = 0; //size of connection pool
-    //get the size of DBConnection pool
-    poolSize = connectionPool.size();
-    //Check every DBConnection in the pool
-    for ( int i=0; i<poolSize; i++)
-    {
-      
-      db = (DBConnection) connectionPool.elementAt(i);
-      //check the status of db. If it is free, count it
-      if (db.getStatus() == BUSY)
-      {
-        logMetacat.warn("This method having a busy DBConnection: "
-                                    +db.getCheckOutMethodName());
-        logMetacat.warn("The busy DBConnection tag is: "
-                                    +db.getTag());
-      }//if
-    }//for
-  
-  }//printMethodNameHavingBusyDBConnection
-  
-  /**
-   * Method to decrease dbconnection pool size when all dbconnections are idle
-   * If all connections are free and connection pool size greater than 
-   * initial value, shrink connection pool size to intital value
-   */
-  public static synchronized boolean shrinkConnectionPoolSize() 
-  {
-     int connectionPoolSize = 0; //store the number of dbconnection pool size
-     int freeConnectionSize = 0; //store the number of free dbconnection in pool
-     int difference = 0; // store the difference number between connection size
-                         // and free connection
-     boolean hasException = false; //to check if has a exception happend
-     boolean result = false; //result
-     DBConnection conn = null; // the dbconnection
-     connectionPoolSize = connectionPool.size();
-     freeConnectionSize = getFreeDBConnectionNumber();
-     difference = connectionPoolSize - freeConnectionSize;
-
-     if(freeConnectionSize < connectionPoolSize){
-    	 logMetacat.warn(difference + " connection(s) " +
-                        "being used and connection pool size is " +connectionPoolSize);
-     } else {
-    	 logMetacat.debug("Connection pool size: " +connectionPoolSize);
-    	 logMetacat.debug("Free Connection number: "+freeConnectionSize);
-     }
-     
-     //If all connections are free and connection pool size greater than 
-     //initial value, shrink connection pool size to intital value
-     if (difference == 0 && connectionPoolSize > INITIALCONNECTIONNUMBER)
-     {
-       //db connection having index from  to connectionpoolsize -1
-       //intialConnectionnumber should be close and remove from pool
-       for ( int i=connectionPoolSize-1; i >= INITIALCONNECTIONNUMBER ; i--)
-       {
-        
-         //get the dbconnection from pool
-         conn = (DBConnection) connectionPool.elementAt(i);
-         
-         try
-         {
-           //close conn
-           conn.close();
-         }//try
-         catch (SQLException e)
-         { 
-           // set hadException ture
-           hasException = true;
-           logMetacat.error("Couldn't close a DBConnection in " +
-                            "DBConnectionPool.shrinkDBConnectionPoolSize: " +
-                            e.getMessage());
-         }//catch
-                                        
-        //remove it from pool
-        connectionPool.remove(i);
-        // becuase enter the loop, set result true
-        result = true;
-       }//for
-     }//if
-     
-     //if hasException is true ( there at least once exception happend)
-     // the result should be false
-     if (hasException)
-     {
-       result =false;
-     }//if
-     // return result
-     return result;
-  }//shrinkDBConnectionPoolSize
-   
-    /**
-   * Method to decrease dbconnection pool size when all dbconnections are idle
-   * If all connections are free and connection pool size greater than 
-   * initial value, shrink connection pool size to intital value
-   */
-  public static synchronized void shrinkDBConnectionPoolSize() 
-  {
-     int connectionPoolSize = 0; //store the number of dbconnection pool size
-     int freeConnectionSize = 0; //store the number of free dbconnection in pool
-     int difference = 0; // store the difference number between connection size
-                         // and free connection
-    
-     DBConnection conn = null; // the dbconnection
-     connectionPoolSize = connectionPool.size();
-     freeConnectionSize = getFreeDBConnectionNumber();
-     difference = connectionPoolSize - freeConnectionSize;
-
-     if(freeConnectionSize < connectionPoolSize){
-         logMetacat.warn(difference + " connection(s) " +
-                        "being used and connection pool size is " +connectionPoolSize);
-     } else {
-         logMetacat.debug("Connection pool size: " +connectionPoolSize);
-         logMetacat.debug("Free Connection number: "+freeConnectionSize);
-     }
-     
-     //If all connections are free and connection pool size greater than 
-     //initial value, shrink connection pool size to intital value
-     if (difference == 0 && connectionPoolSize > INITIALCONNECTIONNUMBER)
-     {
-       //db connection having index from  to connectionpoolsize -1
-       //intialConnectionnumber should be close and remove from pool
-       for ( int i=connectionPoolSize-1; i >= INITIALCONNECTIONNUMBER ; i--)
-       {
-        
-         //get the dbconnection from pool
-         conn = (DBConnection) connectionPool.elementAt(i);
-         //make sure again the DBConnection status is free
-         if (conn.getStatus()==FREE)
-         {
-           try
-           {
-             //close conn
-             conn.close();
-           }//try
-           catch (SQLException e)
-           { 
-          
-             logMetacat.error("Couldn't close a DBConnection in " +
-                            "DBConnectionPool.shrinkDBConnectionPoolSize: " +
-                            e.getMessage());
-           }//catch
-        
-           //remove it from pool
-           connectionPool.remove(i);
-         }//if
-       
-       }//for
-     }//if
-     
-    
-  }//shrinkDBConnectionPoolSize
-   
-  
-}//DBConnectionPool

Property changes on: src/edu/ucsb/nceas/metacat/DBConnectionPool.java
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Index: src/edu/ucsb/nceas/metacat/HandlerException.java
===================================================================
--- src/edu/ucsb/nceas/metacat/HandlerException.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/HandlerException.java	(nonexistent)
@@ -1,46 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: An Exception thrown when an error occurs because an 
- *             AccessionNumber was invalid or used incorrectly
- *  Copyright: 2008 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Michael Daigle
- *
- *   '$Author: daigle $'
- *     '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
- * '$Revision: 4080 $'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.metacat;
-
-/**
- * Exception thrown when an error occurs in a configuration administrative
- * class
- */
-public class HandlerException extends Exception {
-
-	private static final long serialVersionUID = 7997030775672963304L;
-
-	/**
-	 * Create a new AdminException.
-	 *
-	 * @param message The error or warning message.
-	 */
-	public HandlerException(String message) {
-		super(message);
-	}
-}

Property changes on: src/edu/ucsb/nceas/metacat/HandlerException.java
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: src/edu/ucsb/nceas/metacat/DBConnection.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBConnection.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBConnection.java	(nonexistent)
@@ -1,449 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: A class represent a connection object, it includes connction 
- *    itself, index, status, age and usageCount.
- *  Copyright: 2000 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Jing Tao
- *
- *   '$Author$'
- *     '$Date$'
- * '$Revision$'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.metacat;
-
-import java.io.*;
-import java.sql.*;
-
-import org.apache.log4j.Logger;
-
-import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.utilities.PropertyNotFoundException;
-
-/**
- * A class represent a connection object, it includes connection itself, 
- * index, status, age, createtime, connection time, usageCount, warning message
- */
- 
-public class DBConnection 
-{
-  private Connection conn;
-  private String tag;//to idenify this object
-  private int status;// free or using
-  private long age;
-  private long createTime;
-  private long connectionTime; //how long it use for connections, 
-                               //it is accumulated
-  private long checkOutTime; //the time when check it out
-  private int usageCount;// how many time the connection was used
-  private int checkOutSerialNumber; // a number to identify same check out.
-                                     //for a connection
-  private SQLWarning warningMessage;
-  private String checkOutMethodName;
-  
-  private static String  DBDriver;
-  private static String  DBConnectedJDBC;
-  private static String  userName;
-  private static String  passWord;
-  
-  private static Logger logMetacat = Logger.getLogger(DBConnection.class);
-
-  /**
-   * Default constructor of the DBConnection class 
-   * 
-   */
-  public DBConnection()  throws SQLException
-  {
-	try {
-		DBDriver = PropertyService.getProperty("database.driver");
-		DBConnectedJDBC = PropertyService.getProperty("database.connectionURI");
-		userName = PropertyService.getProperty("database.user");
-		passWord = PropertyService.getProperty("database.password");
-	} catch (PropertyNotFoundException pnfe) {
-		System.err.println("Could not get property in static block: "
-			+ pnfe.getMessage());
-	}
-	  
-    conn = openConnection();
-    tag = conn.toString();
-    status = 0;
-    age = 0;
-    createTime = System.currentTimeMillis();
-    connectionTime = 0;
-    checkOutTime = 0;
-    usageCount= 0;
-    checkOutSerialNumber=0;
-    warningMessage = null;
-    checkOutMethodName = null;
-    
-  }
-  
- 
-  
-  /**
-   * get the  connetion from the object
-   */
-  public Connection getConnections()
-  {
-    return conn;
-  }
-  
-  /**
-   * Set a connection to this object
-   * @param myDBConnection, the connection which will be assign to this object
-   */
-  public void setConnections( Connection myConnection)
-  {
-    this.conn = myConnection;
-  }
-
-  /**
-   * get the db connetion tag from the object
-   */
-  public String getTag()
-  {
-    return tag;
-  }
-  
-  /**
-   * Set a connection status to this object
-   * @param myTag, the tag which will be assign to this object
-   */
-  public void setTag(String myTag)
-  {
-    this.tag = myTag;
-  }
-  
-  /**
-   * get the db connetion status from the object
-   */
-  public int getStatus()
-  {
-    return status;
-  }
-  
-  /**
-   * Set a connection status to this object
-   * @param myStatus, the status which will be assign to this object
-   * 0 is free, 1 is using
-   */
-  public void setStatus(int myStatus)
-  {
-    this.status = myStatus;
-  }
-  
-  /**
-   * get the db connetion age from the object
-   */
-  public long getAge()
-  {
-    return (System.currentTimeMillis() - createTime);
-  }
-  
- 
-  /**
-   * Set a connection age to this object
-   * @param myAge, the Age which will be assign to this object
-   */
-  public void setAge(long myAge)
-  {
-    this.age = myAge;
-  }  
-  
-  /**
-   * get the db connetion created time from the object
-   */
-  public long getCreateTime()
-  {
-    return createTime;
-  }
-  
-  /**
-   * Set a usage number to this object
-   * @param myCreateTime, the create time which will be assign to this object
-   */
-  public void setCreateTime(long myCreateTime)
-  {
-    this.createTime = myCreateTime;
-  }
-  
-  /**
-   * get the how long db connetion used for the object
-   */
-  public long getConnectionTime()
-  {
-    return connectionTime;
-  }
-  
- 
-  /**
-   * Set a connection time to this object
-   * It is accumulated
-   * @param myConnectionTime, the connection time which will assign to
-   * this object
-   */
-  public void setConnectionTime(long myConnectionTime)
-  {
-    this.connectionTime = this.connectionTime + myConnectionTime;
-  }
-  
-  /**
-   * get the when a db connetion was checked out
-   */
-  public long getCheckOutTime()
-  {
-    return checkOutTime;
-  }
-  
- 
-  /**
-   * Set check out time to this object
-  
-   * @param myCheckOutTime, the check out time which will assign to
-   * this object
-   */
-  public void setCheckOutTime(long myCheckOutTime)
-  {
-    this.checkOutTime = myCheckOutTime;
-  }
-  
-  /**
-   * get the db connetion usage times from the object
-   */
-  public int getUsageCount()
-  {
-    return usageCount;
-  }
-   
- 
-  /**
-   * Set a usage number to this object
-   * @param myUsageCount, number of usage which will be assign to this object
-   */
-  public void setUsageCount(int myUsageCount)
-  {
-    this.usageCount = myUsageCount;
-  }
-  
-  /**
-   * Increase a usage number to this object
-   * @param myUsageCount, number of usage which will be add to this object
-   */
-  public void increaseUsageCount(int myUsageCount)
-  {
-    this.usageCount = this.usageCount + myUsageCount;
-  }  
-  
-  /**
-   * get the check out serial number
-   */
-  public int getCheckOutSerialNumber()
-  {
-    return checkOutSerialNumber;
-  }
-  
- 
-  /**
-   * Set check out serial number to this object
-  
-   * @param myCheckOutSerialNumber, the check out serial number which will 
-   * assign to this object
-   */
-  public void setCheckOutSerialNumber(int myCheckOutSerialNumber)
-  {
-    this.checkOutSerialNumber = myCheckOutSerialNumber;
-  }
-  
-  /**
-   * Increase a usage number to this object
-   * @param myUsageCount, number of usage which will be add to this object
-   */
-  public void increaseCheckOutSerialNumber(int myCheckOutSerialNumber)
-  {
-    this.checkOutSerialNumber=this.checkOutSerialNumber+myCheckOutSerialNumber;
-  }  
-  
-  
-  /**
-   * get the db connetion waring message from the object
-   */
-  public SQLWarning getWarningMessage() throws SQLException
-  {
-    //should increase 1 UsageCount
-    increaseUsageCount(1);
-    return conn.getWarnings();
-  }
-  
-  /**
-   * Set a warning message to this object
-   * @param myWarningMessage, the waring which will be assign to this object
-   */
-  public void setWarningMessage(SQLWarning myWarningMessage)
-  {
-     this.warningMessage = myWarningMessage;
-  }
-  
-  /**
-   * get the the name of method checked out the connection from the object
-   */
-  public String getCheckOutMethodName()
-  {
-    return checkOutMethodName;
-  }
-  
-  /**
-   * Set a method name to the checkOutMethodName 
-   * @param myCheckOutMethodName, the name of method will assinged to it
-   */
-  public void setCheckOutMethodName(String myCheckOutMethodName)
-  {
-     this.checkOutMethodName = myCheckOutMethodName;
-  }
-  
-  /**
-   * Close a DBConnection object
-   */
-  public void close() throws SQLException
-  {
-    conn.close();
-    tag = null;
-    status = 0;
-    age = 0;
-    createTime = System.currentTimeMillis();
-    connectionTime = 0;
-    checkOutTime = 0;
-    usageCount= 0;
-    warningMessage = null;
-  }
-  
-    /** 
-   * Method to establish DBConnection 
-   */
-  public static Connection openConnection()
-                  throws SQLException 
-  {
-    return openConnection(DBDriver, DBConnectedJDBC, userName, passWord);
-  }//openDBConnection
-
-  /** 
-   * Method to establish a JDBC database connection 
-   *
-   * @param dbDriver the string representing the database driver
-   * @param connection the string representing the database connectin parameters
-   * @param user name of the user to use for database connection
-   * @param password password for the user to use for database connection
-   */
-  private static Connection openConnection(String dbDriver, String connection,
-                String user, String password)
-                throws SQLException
- {
-     // Load the Oracle JDBC driver
-     try
-     {
-       Class.forName (dbDriver);
-     }
-     catch (ClassNotFoundException e)
-     {
-       logMetacat.error("Error in DBConnectionPool "+e.getMessage());
-       return null;
-     }
-     // Connect to the database
-     Connection connLocal = null;
-     connLocal = DriverManager.getConnection( connection, user, password);
-     return connLocal;
-  }//OpenDBConnection
-  
-  /** 
-   * Method to test a JDBC database connection 
-   *
-   * @param dbDriver the string representing the database driver
-   * @param connection the string representing the database connectin parameters
-   * @param user name of the user to use for database connection
-   * @param password password for the user to use for database connection
-   */
-  public static void testConnection(String dbDriver, String connection,
-                String user, String password)
-                throws SQLException
-  {
-     // Load the Oracle JDBC driver
-     try
-     {
-       Class.forName (dbDriver);
-     }
-     catch (ClassNotFoundException e)
-     {
-       throw new SQLException(e.getMessage());
-     }
-     // Connect to the database
-     Connection connLocal = null;
-     connLocal = DriverManager.getConnection( connection, user, password);
-     connLocal.close();
-  }
-  
-  /**
-   * Method to create a PreparedStatement by sending a sql statement
-   * @Param sql, the sql statement which will be sent to db
-   */
-  public PreparedStatement prepareStatement( String sql ) throws SQLException
-  {
-    return conn.prepareStatement(sql);
-  }//prepareStatement
-  
-  
-  /**
-   * Method to create a Statement
-   */
-  public Statement createStatement() throws SQLException
-  {
-    return conn.createStatement();
-  }//prepareStatement
-
-  /**
-   * Method to make a commit command
-   */
-  public void commit() throws SQLException
-  {
-    conn.commit();
-  }//commit
-  
-  /**
-   * Method to set commit mode
-   * @param autocommit, true of false to auto commit
-   */
-  public void setAutoCommit( boolean autoCommit) throws SQLException
-  {
-    conn.setAutoCommit(autoCommit);
-  }//setAutoCommit
-  
-  /**
-   * Method to roll back
-   */
-  public void rollback() throws SQLException
-  {
-    conn.rollback();
-  }//rollback
-  
-  /**
-   * Method to get meta data
-   */
-  public DatabaseMetaData getMetaData() throws SQLException
-  {
-    return conn.getMetaData();
-  }//getMetaData
-  
-}//DBConnection class

Property changes on: src/edu/ucsb/nceas/metacat/DBConnection.java
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Index: src/edu/ucsb/nceas/metacat/DBVersion.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBVersion.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBVersion.java	(nonexistent)
@@ -1,62 +0,0 @@
-/**
- *  '$RCSfile$'
- *  Copyright: 2008 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *
- *   '$Author$'
- *     '$Date$'
- * '$Revision$'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either DBVersion 2 of the License, or
- * (at your option) any later DBVersion.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-package edu.ucsb.nceas.metacat;
-
-import java.util.Vector;
-
-import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.utilities.StringUtil;
-import edu.ucsb.nceas.utilities.PropertyNotFoundException;
-
-/**
- * @author daigle@nceas.nceas.ucsb.edu
- *
- * DBVersion represents the current DBVersion information for this Metacat instance.
- */
-public class DBVersion extends Version
-{
-	private Vector<String> updateScriptList = null;
-	
-	/**
-	 * Create a database version. Get the update script list from properties for
-	 * this version and save in a vector.
-	 * 
-	 * @param DBVersionId
-	 *            a string representing the version of the database.
-	 * @throws PropertyNotFoundException
-	 */
-    public DBVersion(String DBVersionId) throws PropertyNotFoundException {
-    	super(DBVersionId);
-		String updateScriptString = PropertyService.getProperty("database.upgradeVersion." + DBVersionId);
-    	updateScriptList = StringUtil.toVector(updateScriptString, ',');
-    }
-	
-    /**
-     * Get the update script list for this version
-     * @return a Vector of update script names.
-     */
-    public Vector<String> getUpdateScripts() {
-    	return updateScriptList;
-    }
-}

Property changes on: src/edu/ucsb/nceas/metacat/DBVersion.java
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Index: src/edu/ucsb/nceas/metacat/service/DatabaseService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/service/DatabaseService.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/service/DatabaseService.java	(nonexistent)
@@ -1,106 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: A Class that implements database utility methods 
- *  Copyright: 2008 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Michael Daigle
- * 
- *   '$Author: daigle $'
- *     '$Date: 2008-08-22 16:23:38 -0700 (Fri, 22 Aug 2008) $'
- * '$Revision: 4297 $'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.metacat.service;
-
-import org.apache.log4j.Logger;
-
-import edu.ucsb.nceas.dbadapter.AbstractDatabase;
-
-public class DatabaseService extends BaseService {
-	
-	private static DatabaseService databaseService = null;
-	private static AbstractDatabase dbAdapter;	
-	private static Logger logMetacat = Logger.getLogger(DatabaseService.class);
-
-	/**
-	 * private constructor since this is a singleton
-	 */
-	private DatabaseService() {
-    	// Determine our db adapter class and create an instance of that class
-        try {
-            dbAdapter = (AbstractDatabase) createObject(PropertyService.getProperty("database.adapter"));
-        } catch (Exception e) {
-            logMetacat.error("Could not create dbAdaptor" + e.getMessage());
-            e.printStackTrace();
-        }
-	}
-	
-	/**
-	 * Get the single instance of DatabaseService.
-	 * 
-	 * @return the single instance of DatabaseService
-	 */
-	public static DatabaseService getInstance() {
-		if (databaseService == null) {
-			databaseService = new DatabaseService();
-		}
-		return databaseService;
-	}
-	
-	public boolean refreshable() {
-		return false;
-	}
-	
-	public void doRefresh() throws ServiceException {
-		return;
-	}
-	
-	public void stop() throws ServiceException {
-		return;
-	}
-	
-    /**
-	 * Instantiate a class using the name of the class at runtime
-	 *
-	 * @param className the fully qualified name of the class to instantiate
-	 */
-	public static Object createObject(String className) throws Exception {
-
-		Object object = null;
-		try {
-			Class classDefinition = Class.forName(className);
-			object = classDefinition.newInstance();
-		} catch (InstantiationException e) {
-			throw e;
-		} catch (IllegalAccessException e) {
-			throw e;
-		} catch (ClassNotFoundException e) {
-			throw e;
-		}
-		return object;
-	}
-	
-	/**
-	 * gets the database adapter
-	 * 
-	 * @return AbstractDatabase object for this application's database adapter.
-	 */
-	public static AbstractDatabase getDBAdapter() {
-		return dbAdapter;
-	}
-
-}

Property changes on: src/edu/ucsb/nceas/metacat/service/DatabaseService.java
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: src/edu/ucsb/nceas/metacat/service/BaseService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/service/BaseService.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/service/BaseService.java	(nonexistent)
@@ -1,55 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: A Class that implements utility methods like:
- *             1/ Reding all doctypes from db connection
- *             2/ Reading DTD or Schema file from Metacat catalog system
- *             3/ Reading Lore type Data Guide from db connection
- *  Copyright: 2000 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Jivka Bojilova
- * 
- *   '$Author$'
- *     '$Date$'
- * '$Revision$'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.metacat.service;
-
-/**
- * A suite of utility classes for querying DB
- * 
- */
-public abstract class BaseService {
-
-	// package level method reporting if service is refreshable.  Basically,
-	// we only want ServiceService calling this.
-	public abstract boolean refreshable();
-	
-	// subclass must define doRefresh.  It is only called from the refresh() method.
-	public abstract void doRefresh() throws ServiceException;
-	
-	// package level method to refresh service.  We only want ServiceService 
-	// calling this.
-	public void refresh() throws ServiceException{
-		if (refreshable()) {
-			doRefresh();
-		}
-	}
-	
-	public abstract void stop() throws ServiceException;
-
-}

Property changes on: src/edu/ucsb/nceas/metacat/service/BaseService.java
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Deleted: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/service/ServiceException.java
===================================================================
--- src/edu/ucsb/nceas/metacat/service/ServiceException.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/service/ServiceException.java	(nonexistent)
@@ -1,52 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: An Exception thrown when an error occurs because an 
- *             AccessionNumber was invalid or used incorrectly
- *  Copyright: 2008 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Michael Daigle
- *
- *   '$Author$'
- *     '$Date$'
- * '$Revision$'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.metacat.service;
-
-import edu.ucsb.nceas.shared.BaseException;
-
-/**
- * Exception thrown when an error occurs in a configuration administrative
- * class
- */
-public class ServiceException extends BaseException {
-	
-	private static final long serialVersionUID = -2982801310798091071L;
-
-	/**
-	 * Create a new AdminException.
-	 *
-	 * @param message The error or warning message.
-	 */
-	public ServiceException(String message) {
-		super(message);
-	}
-	
-	public ServiceException(String message, BaseException deeperException) {
-		super(message, deeperException);
-	}
-}

Property changes on: src/edu/ucsb/nceas/metacat/service/ServiceException.java
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Index: src/edu/ucsb/nceas/metacat/util/MetacatUtilException.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/MetacatUtilException.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/MetacatUtilException.java	(nonexistent)
@@ -1,44 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: An Exception thrown when an error occurs because an 
- *             AccessionNumber was invalid or used incorrectly
- *  Copyright: 2008 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Michael Daigle
- *
- *   '$Author$'
- *     '$Date$'
- * '$Revision$'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.metacat.util;
-/**
- * Exception thrown when an error occurs in a utility method
- */
-public class MetacatUtilException extends Exception {
-
-	private static final long serialVersionUID = -253071242028406390L;
-
-    /**
-	 * Create a new AdminException.
-	 *
-	 * @param message The error or warning message.
-	 */
-	public MetacatUtilException(String message) {
-		super(message);
-	}
-}

Property changes on: src/edu/ucsb/nceas/metacat/util/MetacatUtilException.java
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
Deleted: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/util/OrganizationUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/OrganizationUtil.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/OrganizationUtil.java	(revision 5015)
@@ -29,6 +29,7 @@
 import java.util.Vector;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.StringUtil;
 
Index: src/edu/ucsb/nceas/metacat/util/EMLVersionsTransformer.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/EMLVersionsTransformer.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/EMLVersionsTransformer.java	(revision 5015)
@@ -35,11 +35,11 @@
 
 import org.apache.log4j.Logger;
 
-import edu.ucsb.nceas.metacat.DBConnection;
-import edu.ucsb.nceas.metacat.DBConnectionPool;
 import edu.ucsb.nceas.metacat.DocumentImpl;
 import edu.ucsb.nceas.metacat.DocumentImplWrapper;
 import edu.ucsb.nceas.metacat.McdbException;
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 
 import javax.xml.transform.TransformerFactory;
Index: src/edu/ucsb/nceas/metacat/AuthSession.java
===================================================================
--- src/edu/ucsb/nceas/metacat/AuthSession.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/AuthSession.java	(revision 5015)
@@ -36,8 +36,8 @@
 import org.apache.log4j.Logger;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.AuthUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 
 /**
  * A Class that implements session tracking for MetaCatServlet users.
Index: src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java
===================================================================
--- src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java	(revision 5015)
@@ -44,7 +44,7 @@
 import edu.ucsb.nceas.metacat.client.MetacatFactory;
 import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/EML201DocumentCorrector.java
===================================================================
--- src/edu/ucsb/nceas/metacat/EML201DocumentCorrector.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/EML201DocumentCorrector.java	(revision 5015)
@@ -4,6 +4,8 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 
 /**
Index: src/edu/ucsb/nceas/metacat/service/SessionService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/service/SessionService.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/service/SessionService.java	(revision 5015)
@@ -30,6 +30,8 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.shared.BaseService;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SessionData;
 
 public class SessionService extends BaseService {
@@ -44,7 +46,9 @@
 	/**
 	 * private constructor since this is a singleton
 	 */
-	private SessionService() throws ServiceException {
+	private SessionService() throws ServiceException {		
+		_serviceName = "SessionService";
+		
 		sessionHash = new Hashtable<String, SessionData>();
 		logMetacat.debug("Registering public session id: " + PUBLIC_SESSION_ID);
 		registerSession(PUBLIC_SESSION_ID, "public", null, null);
Index: src/edu/ucsb/nceas/metacat/service/SkinPropertyService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/service/SkinPropertyService.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/service/SkinPropertyService.java	(revision 5015)
@@ -39,8 +39,10 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.shared.BaseService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SkinUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
 import edu.ucsb.nceas.utilities.MetaDataProperty;
@@ -75,6 +77,8 @@
 	 */
 	private SkinPropertyService() throws ServiceException {
 		try {
+			_serviceName = "SkinPropertyService";
+			
 			initialize();
 		} catch (GeneralPropertyException gpe) {
 			throw new ServiceException(
Index: src/edu/ucsb/nceas/metacat/DBUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBUtil.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBUtil.java	(revision 5015)
@@ -47,6 +47,8 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
Index: src/edu/ucsb/nceas/metacat/util/AuthUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/AuthUtil.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/AuthUtil.java	(revision 5015)
@@ -34,8 +34,9 @@
 
 import edu.ucsb.nceas.metacat.AuthSession;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
 import edu.ucsb.nceas.metacat.service.SessionService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.StringUtil;
 
Index: src/edu/ucsb/nceas/metacat/util/DatabaseUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/DatabaseUtil.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/DatabaseUtil.java	(revision 5015)
@@ -32,8 +32,9 @@
 
 import org.apache.log4j.Logger;
 
-import edu.ucsb.nceas.metacat.DBVersion;
+import edu.ucsb.nceas.metacat.database.DBVersion;
 import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
 public class DatabaseUtil {
Index: src/edu/ucsb/nceas/metacat/util/SystemUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/SystemUtil.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/SystemUtil.java	(revision 5015)
@@ -36,8 +36,9 @@
 
 import edu.ucsb.nceas.metacat.MetaCatVersion;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
 import edu.ucsb.nceas.metacat.service.ServiceService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.StringUtil;
Index: src/edu/ucsb/nceas/metacat/util/ResponseUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/ResponseUtil.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/ResponseUtil.java	(revision 5015)
@@ -41,7 +41,8 @@
 import org.apache.log4j.Logger;
 
 import edu.ucsb.nceas.metacat.DBTransform;
-import edu.ucsb.nceas.shared.BaseException;
+import edu.ucsb.nceas.metacat.shared.BaseException;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/AccessControlForSingleFile.java
===================================================================
--- src/edu/ucsb/nceas/metacat/AccessControlForSingleFile.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/AccessControlForSingleFile.java	(revision 5015)
@@ -36,6 +36,8 @@
 import java.net.MalformedURLException;
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 
 
Index: src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterRegistration.java
===================================================================
--- src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterRegistration.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterRegistration.java	(revision 5015)
@@ -45,7 +45,7 @@
 import javax.servlet.http.HttpSession;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
 /**
Index: lib/admin/metacat-configuration.jsp
===================================================================
--- lib/admin/metacat-configuration.jsp	(revision 5014)
+++ lib/admin/metacat-configuration.jsp	(revision 5015)
@@ -1,5 +1,5 @@
 <%@ page language="java"  %>
-<%@ page import="edu.ucsb.nceas.metacat.DBVersion,edu.ucsb.nceas.metacat.MetaCatVersion" %>
+<%@ page import="edu.ucsb.nceas.metacat.database.DBVersion,edu.ucsb.nceas.metacat.MetaCatVersion" %>
 <%@ page import="edu.ucsb.nceas.metacat.service.PropertyService" %>
 
 <%
Index: src/edu/ucsb/nceas/metacat/DBValidate.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBValidate.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBValidate.java	(revision 5015)
@@ -42,6 +42,8 @@
 
 import com.arbortext.catalog.*;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 
 /**
Index: src/edu/ucsb/nceas/metacat/QuerySpecification.java
===================================================================
--- src/edu/ucsb/nceas/metacat/QuerySpecification.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/QuerySpecification.java	(revision 5015)
@@ -36,8 +36,8 @@
 import java.util.Stack;
 import java.util.Vector;
 
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 //import edu.ucsb.nceas.utilities.UtilException;
 
Index: src/edu/ucsb/nceas/metacat/SubTree.java
===================================================================
--- src/edu/ucsb/nceas/metacat/SubTree.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/SubTree.java	(revision 5015)
@@ -36,6 +36,8 @@
 import org.apache.log4j.Logger;
 import org.xml.sax.SAXException;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 
 /**
Index: src/edu/ucsb/nceas/metacat/IndexingQueue.java
===================================================================
--- src/edu/ucsb/nceas/metacat/IndexingQueue.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/IndexingQueue.java	(revision 5015)
@@ -33,6 +33,8 @@
 import java.util.HashMap;
 import java.lang.Comparable;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
Index: src/edu/ucsb/nceas/metacat/advancedsearch/AdvancedSearchServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/advancedsearch/AdvancedSearchServlet.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/advancedsearch/AdvancedSearchServlet.java	(revision 5015)
@@ -37,7 +37,7 @@
 
 import edu.ucsb.nceas.metacat.client.*;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/advancedsearch/BrowseServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/advancedsearch/BrowseServlet.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/advancedsearch/BrowseServlet.java	(revision 5015)
@@ -38,7 +38,7 @@
 
 import edu.ucsb.nceas.metacat.client.*;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/advancedsearch/SearchServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/advancedsearch/SearchServlet.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/advancedsearch/SearchServlet.java	(revision 5015)
@@ -37,7 +37,7 @@
 
 import edu.ucsb.nceas.metacat.client.*;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/advancedsearch/LoginServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/advancedsearch/LoginServlet.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/advancedsearch/LoginServlet.java	(revision 5015)
@@ -38,7 +38,7 @@
 
 import edu.ucsb.nceas.metacat.client.*;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/spatial/SpatialHarvester.java
===================================================================
--- src/edu/ucsb/nceas/metacat/spatial/SpatialHarvester.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/spatial/SpatialHarvester.java	(revision 5015)
@@ -31,7 +31,7 @@
 
 import org.apache.log4j.Logger;
 
-import edu.ucsb.nceas.metacat.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnection;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 
 import org.geotools.feature.Feature;
Index: src/edu/ucsb/nceas/metacat/spatial/SpatialDocument.java
===================================================================
--- src/edu/ucsb/nceas/metacat/spatial/SpatialDocument.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/spatial/SpatialDocument.java	(revision 5015)
@@ -24,7 +24,7 @@
 
 import java.io.File;
 
-import edu.ucsb.nceas.metacat.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnection;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
Index: src/edu/ucsb/nceas/metacat/AssociateAccessPolicy.java
===================================================================
--- src/edu/ucsb/nceas/metacat/AssociateAccessPolicy.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/AssociateAccessPolicy.java	(revision 5015)
@@ -49,7 +49,10 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 
+
 /**This class is in order to fix a problem. It doesn't has functionality for 
  *Metacat. 
  *In Currently, some document in xml_document table doesn't have entries in 
Index: src/edu/ucsb/nceas/metacat/ArchiveHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/ArchiveHandler.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/ArchiveHandler.java	(revision 5015)
@@ -35,8 +35,9 @@
 import org.apache.log4j.Logger;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.shared.HandlerException;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.ErrorSendingErrorException;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.ResponseUtil;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.LSIDUtil;
Index: src/edu/ucsb/nceas/metacat/DocumentIdQuery.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DocumentIdQuery.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DocumentIdQuery.java	(revision 5015)
@@ -27,7 +27,7 @@
 import java.util.Hashtable;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
 /**
Index: src/edu/ucsb/nceas/metacat/MetaCatServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 5015)
@@ -74,31 +74,37 @@
 import com.oreilly.servlet.multipart.Part;
 
 import edu.ucsb.nceas.metacat.cart.CartManager;
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+import edu.ucsb.nceas.metacat.database.DatabaseService;
 import edu.ucsb.nceas.metacat.dataquery.DataQuery;
+import edu.ucsb.nceas.metacat.replication.ForceReplicationHandler;
+import edu.ucsb.nceas.metacat.replication.ReplicationService;
 import edu.ucsb.nceas.metacat.scheduler.SchedulerService;
-import edu.ucsb.nceas.metacat.service.DatabaseService;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
 import edu.ucsb.nceas.metacat.service.ServiceService;
 import edu.ucsb.nceas.metacat.service.SessionService;
 import edu.ucsb.nceas.metacat.service.SkinPropertyService;
 import edu.ucsb.nceas.metacat.service.XMLSchemaService;
+import edu.ucsb.nceas.metacat.shared.BaseException;
+import edu.ucsb.nceas.metacat.shared.HandlerException;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.spatial.SpatialHarvester;
 import edu.ucsb.nceas.metacat.spatial.SpatialQuery;
 import edu.ucsb.nceas.metacat.util.AuthUtil;
 import edu.ucsb.nceas.metacat.util.ErrorSendingErrorException;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.RequestUtil;
 import edu.ucsb.nceas.metacat.util.ResponseUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.metacat.util.SessionData;
 import edu.ucsb.nceas.metacat.workflow.WorkflowScheduler;
-import edu.ucsb.nceas.shared.BaseException;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
 import edu.ucsb.nceas.utilities.LSIDUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
+import edu.ucsb.nceas.utilities.UtilException;
 
 /**
  * A metadata catalog server implemented as a Java Servlet
@@ -173,6 +179,7 @@
     public static final String XMLFORMAT = "xml";
     private static final String FALSE = "false";
     private static final String TRUE  = "true";
+    private static String LOG_CONFIG_NAME = null;
     
     /**
      * Initialize the servlet by creating appropriate database connections
@@ -194,11 +201,11 @@
             // Initialize the properties file
             String dirPath = ServiceService.getRealConfigDir();
             
-            String LOG_CONFIG_NAME = dirPath + "/log4j.properties";
+            LOG_CONFIG_NAME = dirPath + "/log4j.properties";
             PropertyConfigurator.configureAndWatch(LOG_CONFIG_NAME);
             
             // Register preliminary services
-            ServiceService.registerService("PropertyService", PropertyService.getInstance());
+            ServiceService.registerService("PropertyService", PropertyService.getInstance());         
             ServiceService.registerService("SkinPropertyService", SkinPropertyService.getInstance());
             ServiceService.registerService("SessionService", SessionService.getInstance()); 
             
@@ -218,9 +225,9 @@
         		"Service problem while intializing MetaCat Servlet: " + se.getMessage();
             logMetacat.error(errorMessage);
             throw new ServletException(errorMessage);
-        } catch (MetacatUtilException ue) {
-        	String errorMessage = 
-        		"Utility problem while intializing MetaCat Servlet: " + ue.getMessage();
+        } catch (MetacatUtilException mue) {
+        	String errorMessage = "Metacat utility problem while intializing MetaCat Servlet: " 
+        		+ mue.getMessage();
             logMetacat.error(errorMessage);
             throw new ServletException(errorMessage);
         } 
@@ -235,6 +242,7 @@
 	 *            the servlet context of MetaCatServlet
 	 */
 	public void initSecondHalf(ServletContext context) throws ServletException {
+		
 		Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
 
 		try {			
@@ -310,7 +318,24 @@
 			} else {
 				logMetacat.info(" \n **** Spatial cache is not set to regenerate on restart");
 			}
+		
+			// Set up the replication log file by setting the "replication.logfile.name" 
+			// system property and reconfiguring the log4j property configurator.
+			String replicationLogPath = PropertyService.getProperty("replication.logdir") 
+				+ FileUtil.getFS() + ReplicationService.REPLICATION_LOG_FILE_NAME;				
+			
+			if (FileUtil.getFileStatus(replicationLogPath) == FileUtil.DOES_NOT_EXIST) {
+				FileUtil.createFile(replicationLogPath);
+			}
 
+			if (FileUtil.getFileStatus(replicationLogPath) < FileUtil.EXISTS_READ_WRITABLE) {
+				logMetacat.error("Replication log file: " + replicationLogPath 
+						+ " does not exist read/writable.");
+			}
+			
+			System.setProperty("replication.logfile.name", replicationLogPath);			
+			PropertyConfigurator.configureAndWatch(LOG_CONFIG_NAME);
+			
 			sitemapScheduled = false;
 
 			fullyInitialized = true;
@@ -317,7 +342,7 @@
 			
 			logMetacat.warn("Metacat (" + MetaCatVersion.getVersionID()
 					+ ") initialized.");
-
+			
 		} catch (SQLException e) {
 			String errorMessage = "SQL problem while intializing MetaCat Servlet: "
 					+ e.getMessage();
@@ -338,7 +363,12 @@
 				+ se.getMessage();
 			logMetacat.error(errorMessage);
 			throw new ServletException(errorMessage);
-		} 
+		} catch (UtilException ue) {
+        	String errorMessage = "Utility problem while intializing MetaCat Servlet: " 
+        		+ ue.getMessage();
+            logMetacat.error(errorMessage);
+            throw new ServletException(errorMessage);
+        } 
 	}
     
     /**
Index: src/edu/ucsb/nceas/metacat/EventLog.java
===================================================================
--- src/edu/ucsb/nceas/metacat/EventLog.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/EventLog.java	(revision 5015)
@@ -31,6 +31,9 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+
 /**
  * EventLog is used to intialize and store a log of events that occur in an
  * application. The events are registered with the logger as they occur, but
Index: src/edu/ucsb/nceas/metacat/ContentTypeProvider.java
===================================================================
--- src/edu/ucsb/nceas/metacat/ContentTypeProvider.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/ContentTypeProvider.java	(revision 5015)
@@ -56,6 +56,8 @@
 
 import org.ecoinformatics.eml.EMLParser;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
Index: src/edu/ucsb/nceas/metacat/IndexingTimerTask.java
===================================================================
--- src/edu/ucsb/nceas/metacat/IndexingTimerTask.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/IndexingTimerTask.java	(revision 5015)
@@ -33,7 +33,9 @@
 import java.util.Vector;
 import java.util.Iterator;
 
-import edu.ucsb.nceas.metacat.service.DatabaseService;
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+import edu.ucsb.nceas.metacat.database.DatabaseService;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 
Index: src/edu/ucsb/nceas/metacat/PermissionController.java
===================================================================
--- src/edu/ucsb/nceas/metacat/PermissionController.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/PermissionController.java	(revision 5015)
@@ -36,6 +36,8 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
Index: src/edu/ucsb/nceas/metacat/DocumentImpl.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DocumentImpl.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DocumentImpl.java	(revision 5015)
@@ -53,15 +53,19 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import edu.ucsb.nceas.metacat.service.DatabaseService;
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+import edu.ucsb.nceas.metacat.database.DatabaseService;
+import edu.ucsb.nceas.metacat.replication.ForceReplicationHandler;
+import edu.ucsb.nceas.metacat.replication.ReplicationService;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.service.XMLSchema;
 import edu.ucsb.nceas.metacat.service.XMLSchemaService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.spatial.SpatialHarvester;
 import edu.ucsb.nceas.metacat.util.AuthUtil;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.StringUtil;
@@ -157,6 +161,7 @@
     private TreeSet<NodeRecord> nodeRecordList = null;
   
     private static Logger logMetacat = Logger.getLogger(DocumentImpl.class);
+    private static Logger logReplication = Logger.getLogger("ReplicationLogging");
 
     /**
      * Default constructor
@@ -696,7 +701,7 @@
          {
            logMetacat.error("Local rev for docid "+ docid + " could not "+
                                   " be found because " + e.getMessage());
-           MetacatReplication.replErrorLog("Docid "+ docid + " could not be "+
+           logReplication.error("Docid "+ docid + " could not be "+
                    "written because error happend to find it's local revision");
            throw new Exception (e.getMessage());
          }
@@ -762,20 +767,20 @@
             //saying that he/she needs to download a new copy of the file and
             //merge the differences manually.
 
-            String server = MetacatReplication
+            String server = ReplicationService
                     .getServerNameForServerCode(serverCode);
-            MetacatReplication.replLog("attempting to lock " + accnum);
+            logReplication.info("attempting to lock " + accnum);
             URL u = new URL("https://" + server + "?server="
                     + MetacatUtil.getLocalReplicationServerName()
                     + "&action=getlock&updaterev=" + rev + "&docid=" + docid);
             //System.out.println("sending message: " + u.toString());
-            String serverResStr = MetacatReplication.getURLContent(u);
+            String serverResStr = ReplicationService.getURLContent(u);
             String openingtag = serverResStr.substring(0, serverResStr
                     .indexOf(">") + 1);
             if (openingtag.equals("<lockgranted>")) {
                 //the lock was granted go ahead with the insert
                 //System.out.println("In lockgranted");
-                MetacatReplication.replLog("lock granted for " + accnum
+            	logReplication.info("lock granted for " + accnum
                         + " from " + server);
                 flag = true;
                 return flag;
@@ -788,7 +793,7 @@
                 // and try
                 //again.
                 //System.out.println("file locked");
-                MetacatReplication.replLog("lock denied for " + accnum + " on "
+            	logReplication.error("lock denied for " + accnum + " on "
                         + server + " reason: file already locked");
                 throw new Exception(
                         "The file specified is already locked by another "
@@ -802,7 +807,7 @@
                                                              // copy of the
                 //file and merge his version with the new version.
                 //System.out.println("outdated file");
-                MetacatReplication.replLog("lock denied for " + accnum + " on "
+            	logReplication.error("lock denied for " + accnum + " on "
                         + server + " reason: local file outdated");
                 throw new Exception(
                         "The file you are trying to update is an outdated"
@@ -2566,15 +2571,15 @@
             //DocumentIdentifier id = new DocumentIdentifier(accnum);
             int revision = MetacatUtil.getRevisionFromAccessionNumber(accnum);
             String updaterev = (new Integer(revision)).toString();
-            String server = MetacatReplication
+            String server = ReplicationService
                     .getServerNameForServerCode(serverCode);
-            MetacatReplication.replLog("attempting to lock " + accnum);
+            logReplication.info("attempting to lock " + accnum);
             URL u = new URL("https://" + server + "?server="
                     + MetacatUtil.getLocalReplicationServerName()
                     + "&action=getlock&updaterev=" + updaterev + "&docid="
                     + docid);
             //System.out.println("sending message: " + u.toString());
-            String serverResStr = MetacatReplication.getURLContent(u);
+            String serverResStr = ReplicationService.getURLContent(u);
             String openingtag = serverResStr.substring(0, serverResStr
                     .indexOf(">") + 1);
             if (openingtag.equals("<lockgranted>")) {//the lock was granted go
@@ -2582,7 +2587,7 @@
                 XMLReader parser = null;
                 try {
                     //System.out.println("In lockgranted");
-                    MetacatReplication.replLog("lock granted for " + accnum
+                	logReplication.info("lock granted for " + accnum
                             + " from " + server);
                     /*
                      * XMLReader parser = initializeParser(conn, action, docid,
@@ -2636,7 +2641,7 @@
                 // the file is currently locked by another user notify our
                 // user to wait a few minutes, check out a new copy and try
                 // again.
-                MetacatReplication.replLog("lock denied for " + accnum + " on "
+            	logReplication.error("lock denied for " + accnum + " on "
                         + server + " reason: file already locked");
                 throw new Exception(
                         "The file specified is already locked by another "
@@ -2647,7 +2652,7 @@
                 // our file is outdated. notify our user to check out a new
                 // copy of the file and merge his version with the new version.
                 //System.out.println("outdated file");
-                MetacatReplication.replLog("lock denied for " + accnum + " on "
+            	logReplication.info("lock denied for " + accnum + " on "
                         + server + " reason: local file outdated");
                 throw new Exception(
                         "The file you are trying to update is an outdated"
@@ -2910,7 +2915,7 @@
                 // we need to delete the nodes in xml_ndoes.
                 deleteXMLNodes(conn, rootId);
             }
-            MetacatReplication.replErrorLog("Failed to " + "create access "
+            logReplication.error("Failed to " + "create access "
                     + "rule for package: " + accnum + " because "
                     + ee.getMessage());
             logMetacat.error("Failed to  " + "create access "
Index: src/edu/ucsb/nceas/metacat/DocumentImplWrapper.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DocumentImplWrapper.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DocumentImplWrapper.java	(revision 5015)
@@ -29,6 +29,8 @@
 
 import java.io.Reader;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+
 //import edu.ucsb.nceas.metacat.spatial.MetacatSpatialDocument;
 
 /**
Index: src/edu/ucsb/nceas/metacat/DBSAXNode.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBSAXNode.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBSAXNode.java	(revision 5015)
@@ -32,7 +32,9 @@
 import org.apache.log4j.Logger;
 import org.xml.sax.SAXException;
 
-import edu.ucsb.nceas.metacat.service.DatabaseService;
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+import edu.ucsb.nceas.metacat.database.DatabaseService;
 
 /**
  * A Class that represents an XML node and its contents and
Index: src/edu/ucsb/nceas/metacat/RelationHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/RelationHandler.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/RelationHandler.java	(revision 5015)
@@ -20,6 +20,8 @@
  
 package edu.ucsb.nceas.metacat;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.morpho.datapackage.Triple;
Index: src/edu/ucsb/nceas/metacat/service/ServiceService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/service/ServiceService.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/service/ServiceService.java	(revision 5015)
@@ -32,6 +32,8 @@
 import java.util.Hashtable;
 import java.util.Set;
 
+import edu.ucsb.nceas.metacat.shared.BaseService;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 
 public class ServiceService {
Index: src/edu/ucsb/nceas/metacat/service/XMLSchemaService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/service/XMLSchemaService.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/service/XMLSchemaService.java	(revision 5015)
@@ -37,10 +37,12 @@
 
 import org.apache.log4j.Logger;
 
-import edu.ucsb.nceas.metacat.DBConnection;
-import edu.ucsb.nceas.metacat.DBConnectionPool;
 import edu.ucsb.nceas.metacat.DocumentImpl;
 import edu.ucsb.nceas.metacat.MetaCatServlet;
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+import edu.ucsb.nceas.metacat.shared.BaseService;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.StringUtil;
@@ -75,6 +77,8 @@
 	 */
 	private XMLSchemaService() {
 		try {
+			_serviceName = "XMLSchemaService";
+			
 			setUseFullSchemaValidation();
 			populateRegisteredSchemaList();
 			createRegisteredNameSpaceList();
Index: src/edu/ucsb/nceas/metacat/service/PropertyService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/service/PropertyService.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/service/PropertyService.java	(revision 5015)
@@ -37,8 +37,10 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.shared.BaseService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
 import edu.ucsb.nceas.utilities.MetaDataProperty;
@@ -91,7 +93,9 @@
 	 * 
 	 * @param servletContext the context we will use to get relative paths
 	 */
-	private PropertyService() throws ServiceException {
+	private PropertyService() throws ServiceException {		
+		_serviceName = "PropertyService";
+		
 		initialize();		
 	}
 	
Index: src/edu/ucsb/nceas/metacat/AccessionNumber.java
===================================================================
--- src/edu/ucsb/nceas/metacat/AccessionNumber.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/AccessionNumber.java	(revision 5015)
@@ -31,6 +31,8 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/workflow/WorkflowScheduler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/workflow/WorkflowScheduler.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/workflow/WorkflowScheduler.java	(revision 5015)
@@ -44,11 +44,11 @@
 import edu.ucsb.nceas.metacat.scheduler.ScheduledJobParamDAO;
 import edu.ucsb.nceas.metacat.scheduler.SchedulerService;
 import edu.ucsb.nceas.metacat.scheduler.MetacatSchedulerException;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.AccessException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.ErrorSendingErrorException;
 import edu.ucsb.nceas.metacat.util.ResponseUtil;
 import edu.ucsb.nceas.metacat.util.RequestUtil;
-import edu.ucsb.nceas.shared.AccessException;
 import edu.ucsb.nceas.utilities.DateUtil;
 import edu.ucsb.nceas.utilities.UtilException;
 
Index: src/edu/ucsb/nceas/metacat/util/GeoserverUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/GeoserverUtil.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/GeoserverUtil.java	(revision 5015)
@@ -33,6 +33,7 @@
 import java.util.HashMap;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/util/SkinUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/SkinUtil.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/SkinUtil.java	(revision 5015)
@@ -31,6 +31,7 @@
 import org.apache.log4j.Logger;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.StringUtil;
 
Index: src/edu/ucsb/nceas/metacat/util/MetacatUtil.java
===================================================================
--- src/edu/ucsb/nceas/metacat/util/MetacatUtil.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/util/MetacatUtil.java	(revision 5015)
@@ -44,9 +44,10 @@
 import edu.ucsb.nceas.metacat.DBSAXHandler;
 import edu.ucsb.nceas.metacat.NodeRecord;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
 import edu.ucsb.nceas.metacat.service.ServiceService;
 import edu.ucsb.nceas.metacat.service.SkinPropertyService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.FileUtil;
Index: src/edu/ucsb/nceas/metacat/DBQuery.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBQuery.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBQuery.java	(revision 5015)
@@ -48,6 +48,8 @@
 import org.xml.sax.InputSource;
 import org.w3c.dom.ls.*;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.AuthUtil;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
Index: src/edu/ucsb/nceas/metacat/harvesterClient/MetUpload.java
===================================================================
--- src/edu/ucsb/nceas/metacat/harvesterClient/MetUpload.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/harvesterClient/MetUpload.java	(revision 5015)
@@ -43,7 +43,7 @@
 
 import edu.ucsb.nceas.metacat.client.*;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
 import edu.ucsb.nceas.utilities.IOUtil;
Index: src/edu/ucsb/nceas/metacat/database/DBConnection.java
===================================================================
--- src/edu/ucsb/nceas/metacat/database/DBConnection.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/database/DBConnection.java	(revision 5015)
@@ -0,0 +1,449 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A class represent a connection object, it includes connction 
+ *    itself, index, status, age and usageCount.
+ *  Copyright: 2000 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Jing Tao
+ *
+ *   '$Author$'
+ *     '$Date$'
+ * '$Revision$'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.database;
+
+import java.io.*;
+import java.sql.*;
+
+import org.apache.log4j.Logger;
+
+import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.utilities.PropertyNotFoundException;
+
+/**
+ * A class represent a connection object, it includes connection itself, 
+ * index, status, age, createtime, connection time, usageCount, warning message
+ */
+ 
+public class DBConnection 
+{
+  private Connection conn;
+  private String tag;//to idenify this object
+  private int status;// free or using
+  private long age;
+  private long createTime;
+  private long connectionTime; //how long it use for connections, 
+                               //it is accumulated
+  private long checkOutTime; //the time when check it out
+  private int usageCount;// how many time the connection was used
+  private int checkOutSerialNumber; // a number to identify same check out.
+                                     //for a connection
+  private SQLWarning warningMessage;
+  private String checkOutMethodName;
+  
+  private static String  DBDriver;
+  private static String  DBConnectedJDBC;
+  private static String  userName;
+  private static String  passWord;
+  
+  private static Logger logMetacat = Logger.getLogger(DBConnection.class);
+
+  /**
+   * Default constructor of the DBConnection class 
+   * 
+   */
+  public DBConnection()  throws SQLException
+  {
+	try {
+		DBDriver = PropertyService.getProperty("database.driver");
+		DBConnectedJDBC = PropertyService.getProperty("database.connectionURI");
+		userName = PropertyService.getProperty("database.user");
+		passWord = PropertyService.getProperty("database.password");
+	} catch (PropertyNotFoundException pnfe) {
+		System.err.println("Could not get property in static block: "
+			+ pnfe.getMessage());
+	}
+	  
+    conn = openConnection();
+    tag = conn.toString();
+    status = 0;
+    age = 0;
+    createTime = System.currentTimeMillis();
+    connectionTime = 0;
+    checkOutTime = 0;
+    usageCount= 0;
+    checkOutSerialNumber=0;
+    warningMessage = null;
+    checkOutMethodName = null;
+    
+  }
+  
+ 
+  
+  /**
+   * get the  connetion from the object
+   */
+  public Connection getConnections()
+  {
+    return conn;
+  }
+  
+  /**
+   * Set a connection to this object
+   * @param myDBConnection, the connection which will be assign to this object
+   */
+  public void setConnections( Connection myConnection)
+  {
+    this.conn = myConnection;
+  }
+
+  /**
+   * get the db connetion tag from the object
+   */
+  public String getTag()
+  {
+    return tag;
+  }
+  
+  /**
+   * Set a connection status to this object
+   * @param myTag, the tag which will be assign to this object
+   */
+  public void setTag(String myTag)
+  {
+    this.tag = myTag;
+  }
+  
+  /**
+   * get the db connetion status from the object
+   */
+  public int getStatus()
+  {
+    return status;
+  }
+  
+  /**
+   * Set a connection status to this object
+   * @param myStatus, the status which will be assign to this object
+   * 0 is free, 1 is using
+   */
+  public void setStatus(int myStatus)
+  {
+    this.status = myStatus;
+  }
+  
+  /**
+   * get the db connetion age from the object
+   */
+  public long getAge()
+  {
+    return (System.currentTimeMillis() - createTime);
+  }
+  
+ 
+  /**
+   * Set a connection age to this object
+   * @param myAge, the Age which will be assign to this object
+   */
+  public void setAge(long myAge)
+  {
+    this.age = myAge;
+  }  
+  
+  /**
+   * get the db connetion created time from the object
+   */
+  public long getCreateTime()
+  {
+    return createTime;
+  }
+  
+  /**
+   * Set a usage number to this object
+   * @param myCreateTime, the create time which will be assign to this object
+   */
+  public void setCreateTime(long myCreateTime)
+  {
+    this.createTime = myCreateTime;
+  }
+  
+  /**
+   * get the how long db connetion used for the object
+   */
+  public long getConnectionTime()
+  {
+    return connectionTime;
+  }
+  
+ 
+  /**
+   * Set a connection time to this object
+   * It is accumulated
+   * @param myConnectionTime, the connection time which will assign to
+   * this object
+   */
+  public void setConnectionTime(long myConnectionTime)
+  {
+    this.connectionTime = this.connectionTime + myConnectionTime;
+  }
+  
+  /**
+   * get the when a db connetion was checked out
+   */
+  public long getCheckOutTime()
+  {
+    return checkOutTime;
+  }
+  
+ 
+  /**
+   * Set check out time to this object
+  
+   * @param myCheckOutTime, the check out time which will assign to
+   * this object
+   */
+  public void setCheckOutTime(long myCheckOutTime)
+  {
+    this.checkOutTime = myCheckOutTime;
+  }
+  
+  /**
+   * get the db connetion usage times from the object
+   */
+  public int getUsageCount()
+  {
+    return usageCount;
+  }
+   
+ 
+  /**
+   * Set a usage number to this object
+   * @param myUsageCount, number of usage which will be assign to this object
+   */
+  public void setUsageCount(int myUsageCount)
+  {
+    this.usageCount = myUsageCount;
+  }
+  
+  /**
+   * Increase a usage number to this object
+   * @param myUsageCount, number of usage which will be add to this object
+   */
+  public void increaseUsageCount(int myUsageCount)
+  {
+    this.usageCount = this.usageCount + myUsageCount;
+  }  
+  
+  /**
+   * get the check out serial number
+   */
+  public int getCheckOutSerialNumber()
+  {
+    return checkOutSerialNumber;
+  }
+  
+ 
+  /**
+   * Set check out serial number to this object
+  
+   * @param myCheckOutSerialNumber, the check out serial number which will 
+   * assign to this object
+   */
+  public void setCheckOutSerialNumber(int myCheckOutSerialNumber)
+  {
+    this.checkOutSerialNumber = myCheckOutSerialNumber;
+  }
+  
+  /**
+   * Increase a usage number to this object
+   * @param myUsageCount, number of usage which will be add to this object
+   */
+  public void increaseCheckOutSerialNumber(int myCheckOutSerialNumber)
+  {
+    this.checkOutSerialNumber=this.checkOutSerialNumber+myCheckOutSerialNumber;
+  }  
+  
+  
+  /**
+   * get the db connetion waring message from the object
+   */
+  public SQLWarning getWarningMessage() throws SQLException
+  {
+    //should increase 1 UsageCount
+    increaseUsageCount(1);
+    return conn.getWarnings();
+  }
+  
+  /**
+   * Set a warning message to this object
+   * @param myWarningMessage, the waring which will be assign to this object
+   */
+  public void setWarningMessage(SQLWarning myWarningMessage)
+  {
+     this.warningMessage = myWarningMessage;
+  }
+  
+  /**
+   * get the the name of method checked out the connection from the object
+   */
+  public String getCheckOutMethodName()
+  {
+    return checkOutMethodName;
+  }
+  
+  /**
+   * Set a method name to the checkOutMethodName 
+   * @param myCheckOutMethodName, the name of method will assinged to it
+   */
+  public void setCheckOutMethodName(String myCheckOutMethodName)
+  {
+     this.checkOutMethodName = myCheckOutMethodName;
+  }
+  
+  /**
+   * Close a DBConnection object
+   */
+  public void close() throws SQLException
+  {
+    conn.close();
+    tag = null;
+    status = 0;
+    age = 0;
+    createTime = System.currentTimeMillis();
+    connectionTime = 0;
+    checkOutTime = 0;
+    usageCount= 0;
+    warningMessage = null;
+  }
+  
+    /** 
+   * Method to establish DBConnection 
+   */
+  public static Connection openConnection()
+                  throws SQLException 
+  {
+    return openConnection(DBDriver, DBConnectedJDBC, userName, passWord);
+  }//openDBConnection
+
+  /** 
+   * Method to establish a JDBC database connection 
+   *
+   * @param dbDriver the string representing the database driver
+   * @param connection the string representing the database connectin parameters
+   * @param user name of the user to use for database connection
+   * @param password password for the user to use for database connection
+   */
+  private static Connection openConnection(String dbDriver, String connection,
+                String user, String password)
+                throws SQLException
+ {
+     // Load the Oracle JDBC driver
+     try
+     {
+       Class.forName (dbDriver);
+     }
+     catch (ClassNotFoundException e)
+     {
+       logMetacat.error("Error in DBConnectionPool "+e.getMessage());
+       return null;
+     }
+     // Connect to the database
+     Connection connLocal = null;
+     connLocal = DriverManager.getConnection( connection, user, password);
+     return connLocal;
+  }//OpenDBConnection
+  
+  /** 
+   * Method to test a JDBC database connection 
+   *
+   * @param dbDriver the string representing the database driver
+   * @param connection the string representing the database connectin parameters
+   * @param user name of the user to use for database connection
+   * @param password password for the user to use for database connection
+   */
+  public static void testConnection(String dbDriver, String connection,
+                String user, String password)
+                throws SQLException
+  {
+     // Load the Oracle JDBC driver
+     try
+     {
+       Class.forName (dbDriver);
+     }
+     catch (ClassNotFoundException e)
+     {
+       throw new SQLException(e.getMessage());
+     }
+     // Connect to the database
+     Connection connLocal = null;
+     connLocal = DriverManager.getConnection( connection, user, password);
+     connLocal.close();
+  }
+  
+  /**
+   * Method to create a PreparedStatement by sending a sql statement
+   * @Param sql, the sql statement which will be sent to db
+   */
+  public PreparedStatement prepareStatement( String sql ) throws SQLException
+  {
+    return conn.prepareStatement(sql);
+  }//prepareStatement
+  
+  
+  /**
+   * Method to create a Statement
+   */
+  public Statement createStatement() throws SQLException
+  {
+    return conn.createStatement();
+  }//prepareStatement
+
+  /**
+   * Method to make a commit command
+   */
+  public void commit() throws SQLException
+  {
+    conn.commit();
+  }//commit
+  
+  /**
+   * Method to set commit mode
+   * @param autocommit, true of false to auto commit
+   */
+  public void setAutoCommit( boolean autoCommit) throws SQLException
+  {
+    conn.setAutoCommit(autoCommit);
+  }//setAutoCommit
+  
+  /**
+   * Method to roll back
+   */
+  public void rollback() throws SQLException
+  {
+    conn.rollback();
+  }//rollback
+  
+  /**
+   * Method to get meta data
+   */
+  public DatabaseMetaData getMetaData() throws SQLException
+  {
+    return conn.getMetaData();
+  }//getMetaData
+  
+}//DBConnection class

Property changes on: src/edu/ucsb/nceas/metacat/database/DBConnection.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/shared/AccessException.java
===================================================================
--- src/edu/ucsb/nceas/metacat/shared/AccessException.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/shared/AccessException.java	(revision 5015)
@@ -0,0 +1,51 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: An Exception thrown when an error occurs because an 
+ *             AccessionNumber was invalid or used incorrectly
+ *  Copyright: 2008 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Michael Daigle
+ *
+ *   '$Author: daigle $'
+ *     '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
+ * '$Revision: 4080 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.shared;
+
+
+/**
+ * Exception thrown when an error occurs in a configuration administrative
+ * class
+ */
+public class AccessException extends BaseException {
+	
+	private static final long serialVersionUID = -8436697355629175917L;
+
+	/**
+	 * Create a new AccessException.
+	 *
+	 * @param message The error or warning message.
+	 */
+	public AccessException(String message) {
+		super(message);
+	}
+	
+	public AccessException(String message, BaseException deeperException) {
+		super(message, deeperException);
+	}
+}

Property changes on: src/edu/ucsb/nceas/metacat/shared/AccessException.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/shared/BaseAccess.java
===================================================================
--- src/edu/ucsb/nceas/metacat/shared/BaseAccess.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/shared/BaseAccess.java	(revision 5015)
@@ -0,0 +1,55 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A Class that manages database access 
+ *             information.
+ *  Copyright: 2009 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Michael Daigle
+ * 
+ *   '$Author: daigle $'
+ *     '$Date: 2009-03-23 13:56:56 -0800 (Mon, 23 Mar 2009) $'
+ * '$Revision: 4854 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.shared;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+
+public abstract class BaseAccess {
+	
+	protected DBConnection conn = null;
+    protected int serialNumber = -1;
+    protected ResultSet rs = null;
+	
+    protected BaseAccess(String methodName) throws AccessException {
+        //check out DBConnection
+    	try {
+    		conn = DBConnectionPool.
+                	getDBConnection("methodName");
+    		serialNumber = conn.getCheckOutSerialNumber();
+    	} catch (SQLException sqle) {
+    		throw new AccessException("Could not get connection from DB connection pool: " 
+    				+ sqle.getMessage());
+    	}
+    }
+    
+    protected abstract BaseDAO populateDAO(ResultSet resultSet) throws SQLException ;
+}
\ No newline at end of file

Property changes on: src/edu/ucsb/nceas/metacat/shared/BaseAccess.java
___________________________________________________________________
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/QueryTerm.java
===================================================================
--- src/edu/ucsb/nceas/metacat/QueryTerm.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/QueryTerm.java	(revision 5015)
@@ -32,9 +32,9 @@
 import java.util.Vector;
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 
 /** a utility class that represents a single term in a query */
 public class QueryTerm
Index: src/edu/ucsb/nceas/metacat/admin/LoginAdmin.java
===================================================================
--- src/edu/ucsb/nceas/metacat/admin/LoginAdmin.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/admin/LoginAdmin.java	(revision 5015)
@@ -35,9 +35,9 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.AuthUtil;
 import edu.ucsb.nceas.metacat.util.RequestUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 
 /**
  * Control the display of the login page 
Index: src/edu/ucsb/nceas/metacat/admin/BackupAdmin.java
===================================================================
--- src/edu/ucsb/nceas/metacat/admin/BackupAdmin.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/admin/BackupAdmin.java	(revision 5015)
@@ -36,9 +36,9 @@
 import org.apache.log4j.Logger;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
 import edu.ucsb.nceas.metacat.service.ServiceService;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.RequestUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.FileUtil;
Index: src/edu/ucsb/nceas/metacat/SchemaLocationResolver.java
===================================================================
--- src/edu/ucsb/nceas/metacat/SchemaLocationResolver.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/SchemaLocationResolver.java	(revision 5015)
@@ -38,6 +38,8 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.ServiceService;
 import edu.ucsb.nceas.metacat.service.XMLSchemaService;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
Index: src/edu/ucsb/nceas/metacat/AccessControlList.java
===================================================================
--- src/edu/ucsb/nceas/metacat/AccessControlList.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/AccessControlList.java	(revision 5015)
@@ -47,7 +47,9 @@
 import org.xml.sax.helpers.XMLReaderFactory;
 import org.xml.sax.helpers.DefaultHandler;
 
-import edu.ucsb.nceas.metacat.service.DatabaseService;
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+import edu.ucsb.nceas.metacat.database.DatabaseService;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
Index: src/edu/ucsb/nceas/metacat/scheduler/MetacatSchedulerException.java
===================================================================
--- src/edu/ucsb/nceas/metacat/scheduler/MetacatSchedulerException.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/scheduler/MetacatSchedulerException.java	(revision 5015)
@@ -28,7 +28,7 @@
 
 package edu.ucsb.nceas.metacat.scheduler;
 
-import edu.ucsb.nceas.shared.BaseException;
+import edu.ucsb.nceas.metacat.shared.BaseException;
 
 /**
  * Exception thrown when an error occurs in a configuration administrative
Index: src/edu/ucsb/nceas/metacat/database/DBConnectionPool.java
===================================================================
--- src/edu/ucsb/nceas/metacat/database/DBConnectionPool.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/database/DBConnectionPool.java	(revision 5015)
@@ -0,0 +1,798 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A class represent a DBConnection pool. Another user can use the
+ *    object to initial a connection pool, get db connection or return it. 
+ *  Copyright: 2000 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Jing Tao
+ *
+ *   '$Author$'
+ *     '$Date$'
+ * '$Revision$'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.database;
+
+import java.io.*;
+import java.util.Vector;
+import java.lang.*;
+import java.sql.*;
+import java.util.Stack;
+import java.util.Hashtable;
+import java.util.Enumeration;
+
+import org.apache.log4j.Logger;
+
+import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.utilities.PropertyNotFoundException;
+
+/** 
+ * A class represent a DBConnection pool. Another user can use the
+ * object to initial a connection pool, get db connection or return it.
+ * This a singleton class, this means only one instance of this class could
+ * be in the program at one time. 
+ */
+public class DBConnectionPool implements Runnable
+{
+
+  //static attributes
+  private static DBConnectionPool instance;
+  private static Vector connectionPool;
+  private static Thread runner;
+  private static int countOfReachMaximum = 0;
+  private static Logger logMetacat = Logger.getLogger(DBConnectionPool.class);
+
+  private static int maxConnNum;
+  private static int initConnNum;
+  private static int incrConnNum;
+  private static long maxAge;
+  private static long maxConnTime;
+  private static int maxUsageNum;
+  private static String dbConnRecyclThrd;
+  private static long cyclTimeDbConn;
+  
+  final static int MAXIMUMCONNECTIONNUMBER;
+  final static int INITIALCONNECTIONNUMBER;
+  final static int INCREASECONNECTIONNUMBER;
+  final static long MAXIMUMAGE;
+  final static long MAXIMUMCONNECTIONTIME;
+  final static int MAXIMUMUSAGENUMBER;
+  final static String DBCONNECTIONRECYCLETHREAD ;
+  final static long CYCLETIMEOFDBCONNECTION;
+  
+  static {
+		int maxConnNum = 0;
+		int initConnNum = 0;
+		int incrConnNum = 0;
+		long maxAge = 0;
+		long maxConnTime = 0;
+		int maxUsageNum = 0;
+		String dbConnRecyclThrd = null;
+		long cyclTimeDbConn = 0;
+		
+		try {
+			// maximum connection number in the connection pool
+			maxConnNum = Integer.parseInt(PropertyService
+					.getProperty("database.maximumConnections"));
+			initConnNum = Integer.parseInt(PropertyService
+					.getProperty("database.initialConnections"));
+			incrConnNum = Integer.parseInt(PropertyService
+					.getProperty("database.incrementConnections"));
+			maxAge = Integer.parseInt(PropertyService
+					.getProperty("database.maximumConnectionAge"));
+			maxConnTime = Long.parseLong(PropertyService
+					.getProperty("database.maximumConnectionTime"));
+			maxUsageNum = Integer.parseInt(PropertyService
+					.getProperty("database.maximumUsageNumber"));
+			dbConnRecyclThrd = PropertyService
+					.getProperty("database.runDBConnectionRecycleThread");
+			cyclTimeDbConn = Long.parseLong(PropertyService
+					.getProperty("database.cycleTimeOfDBConnection"));
+		} catch (PropertyNotFoundException pnfe) {
+			System.err.println("Could not get property in static block: "
+					+ pnfe.getMessage());
+		}
+		
+		MAXIMUMCONNECTIONNUMBER = maxConnNum;
+		INITIALCONNECTIONNUMBER = initConnNum;
+		INCREASECONNECTIONNUMBER = incrConnNum;
+		MAXIMUMAGE = maxAge;
+		MAXIMUMCONNECTIONTIME = maxConnTime;
+		MAXIMUMUSAGENUMBER = maxUsageNum;
+		DBCONNECTIONRECYCLETHREAD  = dbConnRecyclThrd;
+		CYCLETIMEOFDBCONNECTION = cyclTimeDbConn;
+	}
+  
+  // the number for trying to check out a connection in the pool in
+  // getDBConnection method
+  final static int LIMIT = 2;
+  
+  final static int FREE = 0; //status of a connection
+  final static int BUSY = 1; //statis of a connection
+  /**
+   * Returns the single instance, creating one if it's the
+   * first time this method is called.
+   */
+  public static synchronized DBConnectionPool getInstance()
+                                 throws SQLException 
+  {
+    if (instance == null) {
+      instance = new DBConnectionPool();
+      Logger log = Logger.getLogger(DBConnectionPool.class);
+      log.debug("MaximumConnectionNumber: "+MAXIMUMCONNECTIONNUMBER);
+      log.debug("Intial connection number: "+INITIALCONNECTIONNUMBER);
+      log.debug("Increated connection Number: "+INCREASECONNECTIONNUMBER);
+      log.debug("Maximum connection age: "+MAXIMUMAGE);
+      log.debug("Maximum connection time: "+MAXIMUMCONNECTIONTIME);
+      log.debug("Maximum usage count: "+MAXIMUMUSAGENUMBER);
+      log.debug("Running recycle thread or not: "+DBCONNECTIONRECYCLETHREAD);
+      log.debug("Cycle time of recycle: "+CYCLETIMEOFDBCONNECTION); 
+    }
+    return instance;
+  }
+
+
+  /**
+   * This is a private constructor since it is singleton
+   */
+   
+  private DBConnectionPool()  throws SQLException 
+  {
+    connectionPool = new Vector();
+    initialDBConnectionPool();
+    //running the thread to recycle DBConnection
+    if (DBCONNECTIONRECYCLETHREAD.equals("on"))
+    {
+      runner = new Thread(this);
+      runner.start();
+    }
+  }//DBConnection
+
+  /**
+   * Method to get the size of DBConnectionPool
+   */
+  public int getSizeOfDBConnectionPool()
+  {
+    return connectionPool.size();
+  }
+  
+  
+  /**
+   * Method to initial a pool of DBConnection objects 
+   */
+  private void initialDBConnectionPool() throws SQLException 
+  {
+
+    DBConnection dbConn = null;
+    
+    for ( int i = 0; i < INITIALCONNECTIONNUMBER; i++ ) 
+    {
+      //create a new object of DBConnection
+      //this DBConnection object has a new connection in it
+      //it automatically generate the createtime and tag
+      dbConn = new DBConnection();
+      //put DBConnection into vetor
+      connectionPool.add(dbConn);
+    }    
+    
+  
+  }//initialDBConnectionPool
+  
+  /**
+   * Method to get Connection object (Not DBConnection)
+   */
+  /*public static Connection getConnection() throws SQLException
+  {
+    DBConnection dbConn = null;
+    //get a DBConnection
+    dbConn = getDBConnection();
+    //get connection object in DBConnection object
+    //The following getConnections method is in DBConnection class
+    return dbConn.getConnections();
+  }*/
+  
+ 
+  /**
+   * Method to get a DBConnection in connection pool
+   * 1) try to get a DBConnection from DBConnection pool
+   * 2) if 1) failed, then check the size of pool. If the size reach the
+   *    maximum number of connection, throw a exception: couldn't get one
+   * 3) If the size is less than the maximum number of connectio, create some
+   *    new connections and recursive get one
+   * @param methodName, the name of method which will check connection out
+   */
+  public static synchronized DBConnection getDBConnection(String methodName) 
+                                                throws SQLException
+  {
+    if (instance == null) {
+      instance = DBConnectionPool.getInstance();
+    }
+    DBConnection db = null;
+    int random = 0; //random number
+    int index = 0; //index
+    int size = 0; //size of connection pool
+    logMetacat.debug("Try to checking out connection...");
+    size = connectionPool.size();
+    logMetacat.debug("size of connection pool: "+size);
+    
+     //try every DBConnection in the pool
+    //every DBConnection will be try LIMITE times
+    for (int j=0 ; j<LIMIT; j++)
+    {
+       //create a random number as the started index for connection pool
+      //So that the connection ofindex of 0 wouldn't be a the heaviest user
+      random = (new Double (Math.random()*100)).intValue();
+      for (int i=0; i<size; i++)
+      {
+        index =(i+random)%size;
+        db = (DBConnection) connectionPool.elementAt(index);
+        logMetacat.debug("Index: "+index);
+        logMetacat.debug("Tag: "+db.getTag());
+        logMetacat.debug("Status: "+db.getStatus());
+        //check if the connection is free
+        if (db.getStatus()==FREE)
+        {
+          //If this connection is good, return this DBConnection
+          if (validateDBConnection(db))
+          {
+            
+            //set this DBConnection status
+            db.setStatus(BUSY);
+            //increase checkout serial number
+            db.increaseCheckOutSerialNumber(1);
+            //increase one usageCount
+            db.increaseUsageCount(1);
+            //set method name to DBConnection
+            db.setCheckOutMethodName(methodName);
+            db.setAutoCommit(true);
+            //debug message
+            logMetacat.debug("The connection is checked out: "
+                                       +db.getTag());
+            logMetacat.debug("The method for checking is: " 
+                                              +db.getCheckOutMethodName());
+            logMetacat.debug("The age is "+db.getAge());
+            logMetacat.debug("The usage is "+db.getUsageCount());
+            logMetacat.debug("The conection time it has: "
+                                                +db.getConnectionTime());
+            //set check out time
+            db.setCheckOutTime(System.currentTimeMillis());
+            // set count of reach maximum 0 because it can check out
+            countOfReachMaximum =0;
+            return db;
+          }//if
+          else//The DBConnection has some problem
+          {
+            //close this DBConnection
+            db.close();
+            //remove it form connection pool
+            connectionPool.remove(index);
+            //insert a new DBConnection to same palace
+            db = new DBConnection();
+            connectionPool.insertElementAt(db, index);
+          }//else
+        }//if
+      }//for
+    }//for
+    
+    //if couldn't get a connection, we should increase DBConnection pool
+    //if the connection pool size is less than maximum connection number
+   
+    if ( size < MAXIMUMCONNECTIONNUMBER )
+    {
+       if ((size+INCREASECONNECTIONNUMBER) < MAXIMUMCONNECTIONNUMBER)
+       { 
+         //if we can create INCREASECONNECTIONNUMBER of new DBConnection
+         //add to connection pool
+         for ( int i=0; i<INCREASECONNECTIONNUMBER; i++)
+         {
+           DBConnection dbConn = new DBConnection();
+           connectionPool.add(dbConn);
+         }//for
+       }//if
+       else
+       {
+         //There is no enough room to increase INCREASECONNECTIONNUMBER 
+         //we create new DBCoonection to Maximum connection number
+         for (int i= size+1; i<= MAXIMUMCONNECTIONNUMBER; i++)
+         {
+           DBConnection dbConn = new DBConnection();
+           connectionPool.add(dbConn);
+         }//for
+       }//else
+   
+    }//if
+    else
+    {
+      /*throw new SQLException("The maximum of " +MAXIMUMCONNECTIONNUMBER + 
+                            " open db connections is reached." +
+                            " New db connection to MetaCat" +
+                            " cannot be established.");*/
+       logMetacat.fatal("The maximum of " +MAXIMUMCONNECTIONNUMBER + 
+                            " open db connections is reached." +
+                            " New db connection to MetaCat" +
+                            " cannot be established.");
+       countOfReachMaximum ++;
+       if (countOfReachMaximum >= 10)
+       {
+         countOfReachMaximum =0;
+         logMetacat.fatal("finally could not get dbconnection");
+         return null;
+       }
+       else
+       {
+         //if couldn't get a connection, sleep 20 seconds and try again.
+         try
+         {
+           logMetacat.info("sleep for could not get dbconnection");
+           Thread.sleep(5000);
+         }
+         catch (Exception e)
+        {
+           logMetacat.error("Exception in getDBConnection" + e.getMessage());
+        }
+      }
+         
+      
+    }//else
+    
+    //recursive to get new connection    
+    return getDBConnection(methodName); 
+  }//getDBConnection
+
+ 
+  
+  
+  /** 
+   * Method to check if a db connection works fine or not
+   * Check points include:
+   * 1. check the usageCount if it is too many
+   * 2. check the dbconne age if it is too old
+   * 3. check the connection time if it is too long
+   * 4. run simple sql query
+   *
+   * @param dbConn, the DBConnection object need to check
+   */
+  private static boolean validateDBConnection (DBConnection dbConn)
+  {
+    
+    
+    //Check if the DBConnection usageCount if it is too many
+    if (dbConn.getUsageCount() >= MAXIMUMUSAGENUMBER )
+    {
+      logMetacat.debug("Connection usageCount is too many: "+
+      dbConn.getUsageCount());
+      return false;
+    }
+    
+    //Check if the DBConnection has too much connection time
+    if (dbConn.getConnectionTime() >= MAXIMUMCONNECTIONTIME)
+    {
+      logMetacat.debug("Connection has too much connection time: "+
+      dbConn.getConnectionTime());
+      return false;
+    }
+    
+    //Check if the DBConnection is too old
+    if (dbConn.getAge() >=MAXIMUMAGE)
+    {
+      logMetacat.debug("Connection is too old: "+dbConn.getAge());
+      return false;
+    }
+    
+    //Try to run a simple query
+    try
+    {
+      long startTime=System.currentTimeMillis();
+      DatabaseMetaData metaData = dbConn.getMetaData();
+      long stopTime=System.currentTimeMillis();
+      //increase one usagecount
+      dbConn.increaseUsageCount(1);
+      //increase connection time
+      dbConn.setConnectionTime(stopTime-startTime);
+  
+    }
+    catch (Exception e)
+    {
+      logMetacat.error("Error in validateDBConnection: "
+                                +e.getMessage());
+      return false;
+    }
+    
+    return true;
+    
+  }//validateDBConnection()
+  
+  /**
+   * Method to return a connection to DBConnection pool.
+   * @param conn, the Connection object need to check in
+   */
+  public static synchronized void returnDBConnection(DBConnection conn, 
+                                                              int serialNumber)
+  {
+    int index = -1;
+    DBConnection dbConn = null;
+  
+    index = getIndexOfPoolForConnection(conn);
+    if ( index ==-1 )
+    {
+      logMetacat.info("Couldn't find a DBConnection in the pool"
+                                  +" which have same tag to the returned"
+                                  +" DBConnetion object");
+      return;
+                                  
+    }//if
+    else
+    {
+      //check the paramter - serialNumber which will be keep in calling method
+      //if it is as same as the object's checkoutserial number.
+      //if it is same return it. If it is not same, maybe the connection already
+      // was returned ealier.
+      logMetacat.debug("serial number in Connection: "
+                                      +conn.getCheckOutSerialNumber());
+      logMetacat.debug("serial number in local: "+serialNumber);
+      if (conn.getCheckOutSerialNumber() == serialNumber)
+      {
+        dbConn = (DBConnection) connectionPool.elementAt(index);
+        //set status to free
+        dbConn.setStatus(FREE);
+        //count connection time
+        dbConn.setConnectionTime
+                          (System.currentTimeMillis()-dbConn.getCheckOutTime());
+                          
+        //set check out time to 0
+        dbConn.setCheckOutTime(0);
+        
+        logMetacat.debug("Connection: "+dbConn.getTag()+" checked in.");
+        logMetacat.debug("Connection: "+dbConn.getTag()+"'s status: "
+                                                    +dbConn.getStatus());
+                                                                       
+      }//if
+      else
+      {
+        logMetacat.info("This DBConnection couldn't return");
+      }//else
+    }//else
+   
+ 
+  }//returnConnection
+  
+  /**
+   * Given a returned DBConnection, try to find the index of DBConnection object
+   * in dbConnection pool by comparing DBConnection' tag and conn.toString.
+   * If couldn't find , -1 will be returned.
+   * @param conn, the connection need to be found
+   */
+  private static synchronized int getIndexOfPoolForConnection(DBConnection conn)
+  {
+    int index = -1;
+    String info = null;
+    //if conn is null return -1 too
+    if (conn==null)
+    {
+      return -1;
+    }
+    //get tag of this returned DBConnection
+    info = conn.getTag();
+    //if the tag is null or empty, -1 will be returned
+    if (info==null || info.equals(""))
+    {
+      return index;
+    }
+    //compare this info to the tag of every DBConnection in the pool
+    for ( int i=0; i< connectionPool.size(); i++)
+    {
+      DBConnection dbConn = (DBConnection) connectionPool.elementAt(i);
+      if (info.equals(dbConn.getTag()))
+      {
+        index = i;
+        break;
+      }//if
+    }//for
+    
+    return index;
+  }//getIndexOfPoolForConnection  
+  
+  /**
+   * Method to shut down all connections
+   */
+  public static void release()
+  {
+    
+    //shut down the backgroud recycle thread
+    if (DBCONNECTIONRECYCLETHREAD.equals("on"))
+    {
+      runner.interrupt();
+    }
+    //cose every dbconnection in the pool
+    synchronized(connectionPool)
+    {
+      for (int i=0;i<connectionPool.size();i++)
+      {
+        try
+        {
+          DBConnection dbConn= (DBConnection) connectionPool.elementAt(i);
+          dbConn.close();
+        }//try
+        catch (SQLException e)
+        {
+          logMetacat.error("Error in release connection: "
+                                            +e.getMessage());
+        }//catch
+      }//for
+    }//synchronized
+  }//release()
+  
+  /**
+   * periodically to recycle the connection
+   */
+  public void run()
+  {
+    DBConnection dbConn = null;
+    //keep the thread running
+    while (true)
+    {
+      //check every dbconnection in the pool
+      synchronized(connectionPool)
+      {
+        for (int i=0; i<connectionPool.size(); i++)
+        {
+          dbConn = (DBConnection) connectionPool.elementAt(i);
+          
+          //if a DBConnection conncectioning time for one check out is greater 
+          //than 30000 milliseconds print it out
+          if (dbConn.getStatus()==BUSY && 
+            (System.currentTimeMillis()-dbConn.getCheckOutTime())>=30000)
+          {
+            logMetacat.fatal("This DBConnection is checked out for: "
+            +(System.currentTimeMillis()-dbConn.getCheckOutTime())/1000
+            +" secs");
+            logMetacat.fatal(dbConn.getTag());
+            logMetacat.error("method: "
+                                          +dbConn.getCheckOutMethodName());
+            
+          }
+          
+          //check the validation of free connection in the pool
+          if (dbConn.getStatus() == FREE)
+          {
+            try
+            {
+              //try to print out the warning message for every connection
+              if (dbConn.getWarningMessage()!=null)
+              {
+                logMetacat.warn("Warning for connection "
+                  +dbConn.getTag()+" : "+ dbConn.getWarningMessage());
+              }
+              //check if it is valiate, if not create new one and replace old one
+              if (!validateDBConnection(dbConn))
+              {
+                logMetacat.debug("Recyle it: "+ dbConn.getTag());
+                //close this DBConnection
+                dbConn.close();
+                //remove it form connection pool
+                connectionPool.remove(i);
+                //insert a new DBConnection to same palace
+                dbConn = new DBConnection();
+                connectionPool.insertElementAt(dbConn, i);
+               }//if
+            }//try
+            catch (SQLException e)
+            {
+              logMetacat.error("Error in DBConnectionPool.run: "
+                                              +e.getMessage());
+            }//catch
+          }//if
+        }//for
+      }//synchronize   
+      //Thread sleep 
+      try
+      {
+        Thread.sleep(CYCLETIMEOFDBCONNECTION);
+      }
+      catch (Exception e)
+      {
+        logMetacat.error("Error in DBConnectionPool.run: "
+                                              +e.getMessage());
+      }
+    }//while
+  }//run
+  
+  /**
+   * Method to get the number of free DBConnection in DBConnection pool
+   */
+  public static synchronized int getFreeDBConnectionNumber()
+  {
+    int numberOfFreeDBConnetion = 0; //return number
+    DBConnection db = null; //single DBconnection
+    int poolSize = 0; //size of connection pool
+    //get the size of DBConnection pool
+    poolSize = connectionPool.size();
+    //Check every DBConnection in the pool
+    for ( int i=0; i<poolSize; i++)
+    {
+      
+      db = (DBConnection) connectionPool.elementAt(i);
+      //check the status of db. If it is free, count it
+      if (db.getStatus() == FREE)
+      {
+        numberOfFreeDBConnetion++;
+      }//if
+    }//for
+    //return the count result
+    return numberOfFreeDBConnetion;
+  }//getFreeDBConnectionNumber
+      
+   /**
+   * Method to print out the method name which have busy DBconnection
+   */
+  public void printMethodNameHavingBusyDBConnection()
+  {
+    
+    DBConnection db = null; //single DBconnection
+    int poolSize = 0; //size of connection pool
+    //get the size of DBConnection pool
+    poolSize = connectionPool.size();
+    //Check every DBConnection in the pool
+    for ( int i=0; i<poolSize; i++)
+    {
+      
+      db = (DBConnection) connectionPool.elementAt(i);
+      //check the status of db. If it is free, count it
+      if (db.getStatus() == BUSY)
+      {
+        logMetacat.warn("This method having a busy DBConnection: "
+                                    +db.getCheckOutMethodName());
+        logMetacat.warn("The busy DBConnection tag is: "
+                                    +db.getTag());
+      }//if
+    }//for
+  
+  }//printMethodNameHavingBusyDBConnection
+  
+  /**
+   * Method to decrease dbconnection pool size when all dbconnections are idle
+   * If all connections are free and connection pool size greater than 
+   * initial value, shrink connection pool size to intital value
+   */
+  public static synchronized boolean shrinkConnectionPoolSize() 
+  {
+     int connectionPoolSize = 0; //store the number of dbconnection pool size
+     int freeConnectionSize = 0; //store the number of free dbconnection in pool
+     int difference = 0; // store the difference number between connection size
+                         // and free connection
+     boolean hasException = false; //to check if has a exception happend
+     boolean result = false; //result
+     DBConnection conn = null; // the dbconnection
+     connectionPoolSize = connectionPool.size();
+     freeConnectionSize = getFreeDBConnectionNumber();
+     difference = connectionPoolSize - freeConnectionSize;
+
+     if(freeConnectionSize < connectionPoolSize){
+    	 logMetacat.warn(difference + " connection(s) " +
+                        "being used and connection pool size is " +connectionPoolSize);
+     } else {
+    	 logMetacat.debug("Connection pool size: " +connectionPoolSize);
+    	 logMetacat.debug("Free Connection number: "+freeConnectionSize);
+     }
+     
+     //If all connections are free and connection pool size greater than 
+     //initial value, shrink connection pool size to intital value
+     if (difference == 0 && connectionPoolSize > INITIALCONNECTIONNUMBER)
+     {
+       //db connection having index from  to connectionpoolsize -1
+       //intialConnectionnumber should be close and remove from pool
+       for ( int i=connectionPoolSize-1; i >= INITIALCONNECTIONNUMBER ; i--)
+       {
+        
+         //get the dbconnection from pool
+         conn = (DBConnection) connectionPool.elementAt(i);
+         
+         try
+         {
+           //close conn
+           conn.close();
+         }//try
+         catch (SQLException e)
+         { 
+           // set hadException ture
+           hasException = true;
+           logMetacat.error("Couldn't close a DBConnection in " +
+                            "DBConnectionPool.shrinkDBConnectionPoolSize: " +
+                            e.getMessage());
+         }//catch
+                                        
+        //remove it from pool
+        connectionPool.remove(i);
+        // becuase enter the loop, set result true
+        result = true;
+       }//for
+     }//if
+     
+     //if hasException is true ( there at least once exception happend)
+     // the result should be false
+     if (hasException)
+     {
+       result =false;
+     }//if
+     // return result
+     return result;
+  }//shrinkDBConnectionPoolSize
+   
+    /**
+   * Method to decrease dbconnection pool size when all dbconnections are idle
+   * If all connections are free and connection pool size greater than 
+   * initial value, shrink connection pool size to intital value
+   */
+  public static synchronized void shrinkDBConnectionPoolSize() 
+  {
+     int connectionPoolSize = 0; //store the number of dbconnection pool size
+     int freeConnectionSize = 0; //store the number of free dbconnection in pool
+     int difference = 0; // store the difference number between connection size
+                         // and free connection
+    
+     DBConnection conn = null; // the dbconnection
+     connectionPoolSize = connectionPool.size();
+     freeConnectionSize = getFreeDBConnectionNumber();
+     difference = connectionPoolSize - freeConnectionSize;
+
+     if(freeConnectionSize < connectionPoolSize){
+         logMetacat.warn(difference + " connection(s) " +
+                        "being used and connection pool size is " +connectionPoolSize);
+     } else {
+         logMetacat.debug("Connection pool size: " +connectionPoolSize);
+         logMetacat.debug("Free Connection number: "+freeConnectionSize);
+     }
+     
+     //If all connections are free and connection pool size greater than 
+     //initial value, shrink connection pool size to intital value
+     if (difference == 0 && connectionPoolSize > INITIALCONNECTIONNUMBER)
+     {
+       //db connection having index from  to connectionpoolsize -1
+       //intialConnectionnumber should be close and remove from pool
+       for ( int i=connectionPoolSize-1; i >= INITIALCONNECTIONNUMBER ; i--)
+       {
+        
+         //get the dbconnection from pool
+         conn = (DBConnection) connectionPool.elementAt(i);
+         //make sure again the DBConnection status is free
+         if (conn.getStatus()==FREE)
+         {
+           try
+           {
+             //close conn
+             conn.close();
+           }//try
+           catch (SQLException e)
+           { 
+          
+             logMetacat.error("Couldn't close a DBConnection in " +
+                            "DBConnectionPool.shrinkDBConnectionPoolSize: " +
+                            e.getMessage());
+           }//catch
+        
+           //remove it from pool
+           connectionPool.remove(i);
+         }//if
+       
+       }//for
+     }//if
+     
+    
+  }//shrinkDBConnectionPoolSize
+   
+  
+}//DBConnectionPool

Property changes on: src/edu/ucsb/nceas/metacat/database/DBConnectionPool.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/shared/ServiceException.java
===================================================================
--- src/edu/ucsb/nceas/metacat/shared/ServiceException.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/shared/ServiceException.java	(revision 5015)
@@ -0,0 +1,51 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: An Exception thrown when an error occurs because an 
+ *             AccessionNumber was invalid or used incorrectly
+ *  Copyright: 2008 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Michael Daigle
+ *
+ *   '$Author$'
+ *     '$Date$'
+ * '$Revision$'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.shared;
+
+
+/**
+ * Exception thrown when an error occurs in a configuration administrative
+ * class
+ */
+public class ServiceException extends BaseException {
+	
+	private static final long serialVersionUID = -2982801310798091071L;
+
+	/**
+	 * Create a new AdminException.
+	 *
+	 * @param message The error or warning message.
+	 */
+	public ServiceException(String message) {
+		super(message);
+	}
+	
+	public ServiceException(String message, BaseException deeperException) {
+		super(message, deeperException);
+	}
+}

Property changes on: src/edu/ucsb/nceas/metacat/shared/ServiceException.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/shared/MetacatUtilException.java
===================================================================
--- src/edu/ucsb/nceas/metacat/shared/MetacatUtilException.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/shared/MetacatUtilException.java	(revision 5015)
@@ -0,0 +1,44 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: An Exception thrown when an error occurs because an 
+ *             AccessionNumber was invalid or used incorrectly
+ *  Copyright: 2008 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Michael Daigle
+ *
+ *   '$Author$'
+ *     '$Date$'
+ * '$Revision$'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.shared;
+/**
+ * Exception thrown when an error occurs in a utility method
+ */
+public class MetacatUtilException extends Exception {
+
+	private static final long serialVersionUID = -253071242028406390L;
+
+    /**
+	 * Create a new AdminException.
+	 *
+	 * @param message The error or warning message.
+	 */
+	public MetacatUtilException(String message) {
+		super(message);
+	}
+}

Property changes on: src/edu/ucsb/nceas/metacat/shared/MetacatUtilException.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/oaipmh/provider/server/OAIHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/oaipmh/provider/server/OAIHandler.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/oaipmh/provider/server/OAIHandler.java	(revision 5015)
@@ -42,7 +42,7 @@
 import edu.ucsb.nceas.metacat.oaipmh.provider.server.crosswalk.Eml;
 import edu.ucsb.nceas.metacat.oaipmh.provider.server.crosswalk.Eml2oai_dc;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 
 import ORG.oclc.oai.server.catalog.AbstractCatalog;
 import ORG.oclc.oai.server.verb.BadVerb;
Index: src/edu/ucsb/nceas/metacat/DBEntityResolver.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBEntityResolver.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBEntityResolver.java	(revision 5015)
@@ -31,6 +31,8 @@
 import org.xml.sax.*;
 import org.xml.sax.helpers.DefaultHandler;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/admin/MetaCatAdminServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/admin/MetaCatAdminServlet.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/admin/MetaCatAdminServlet.java	(revision 5015)
@@ -41,12 +41,12 @@
 import edu.ucsb.nceas.metacat.MetaCatServlet;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.service.SessionService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.AuthUtil;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.metacat.util.RequestUtil;
 import edu.ucsb.nceas.metacat.util.SkinUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
 
 /**
Index: src/edu/ucsb/nceas/metacat/Eml210SAXHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/Eml210SAXHandler.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/Eml210SAXHandler.java	(revision 5015)
@@ -47,6 +47,8 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
Index: src/edu/ucsb/nceas/metacat/DBSimpleQuery.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBSimpleQuery.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBSimpleQuery.java	(revision 5015)
@@ -37,6 +37,9 @@
 import java.util.Hashtable;
 import java.util.Enumeration;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+
 /** 
  * A Class that searches a relational DB for elements and attributes that
  * have free text matches to the query string.  It returns a result set 
Index: src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobParamDAO.java
===================================================================
--- src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobParamDAO.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobParamDAO.java	(revision 5015)
@@ -27,7 +27,7 @@
 
 package edu.ucsb.nceas.metacat.scheduler;
 
-import edu.ucsb.nceas.shared.BaseDAO;
+import edu.ucsb.nceas.metacat.shared.BaseDAO;
 
 public class ScheduledJobParamDAO extends BaseDAO {
 
Index: src/edu/ucsb/nceas/metacat/QueryGroup.java
===================================================================
--- src/edu/ucsb/nceas/metacat/QueryGroup.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/QueryGroup.java	(revision 5015)
@@ -30,9 +30,9 @@
 package edu.ucsb.nceas.metacat;
 
 import edu.ucsb.nceas.dbadapter.*;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 
 import java.io.*;
 import java.util.Hashtable;
Index: src/edu/ucsb/nceas/metacat/database/DBVersion.java
===================================================================
--- src/edu/ucsb/nceas/metacat/database/DBVersion.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/database/DBVersion.java	(revision 5015)
@@ -0,0 +1,63 @@
+/**
+ *  '$RCSfile$'
+ *  Copyright: 2008 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *
+ *   '$Author$'
+ *     '$Date$'
+ * '$Revision$'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either DBVersion 2 of the License, or
+ * (at your option) any later DBVersion.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+package edu.ucsb.nceas.metacat.database;
+
+import java.util.Vector;
+
+import edu.ucsb.nceas.metacat.Version;
+import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.utilities.StringUtil;
+import edu.ucsb.nceas.utilities.PropertyNotFoundException;
+
+/**
+ * @author daigle@nceas.nceas.ucsb.edu
+ *
+ * DBVersion represents the current DBVersion information for this Metacat instance.
+ */
+public class DBVersion extends Version
+{
+	private Vector<String> updateScriptList = null;
+	
+	/**
+	 * Create a database version. Get the update script list from properties for
+	 * this version and save in a vector.
+	 * 
+	 * @param DBVersionId
+	 *            a string representing the version of the database.
+	 * @throws PropertyNotFoundException
+	 */
+    public DBVersion(String DBVersionId) throws PropertyNotFoundException {
+    	super(DBVersionId);
+		String updateScriptString = PropertyService.getProperty("database.upgradeVersion." + DBVersionId);
+    	updateScriptList = StringUtil.toVector(updateScriptString, ',');
+    }
+	
+    /**
+     * Get the update script list for this version
+     * @return a Vector of update script names.
+     */
+    public Vector<String> getUpdateScripts() {
+    	return updateScriptList;
+    }
+}

Property changes on: src/edu/ucsb/nceas/metacat/database/DBVersion.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/shared/BaseService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/shared/BaseService.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/shared/BaseService.java	(revision 5015)
@@ -0,0 +1,59 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A Class that implements utility methods like:
+ *             1/ Reding all doctypes from db connection
+ *             2/ Reading DTD or Schema file from Metacat catalog system
+ *             3/ Reading Lore type Data Guide from db connection
+ *  Copyright: 2000 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Jivka Bojilova
+ * 
+ *   '$Author$'
+ *     '$Date$'
+ * '$Revision$'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.shared;
+
+
+/**
+ * A suite of utility classes for querying DB
+ * 
+ */
+public abstract class BaseService {
+	protected String _serviceName = null;
+
+	// package level method reporting if service is refreshable.  Basically,
+	// we only want ServiceService calling this.
+	public abstract boolean refreshable();
+	
+	// subclass must define doRefresh.  It is only called from the refresh() method.
+	protected abstract void doRefresh() throws ServiceException;
+	
+	// package level method to refresh service.  We only want ServiceService 
+	// calling this.
+	public void refresh() throws ServiceException{
+		if (refreshable()) {
+			doRefresh();
+		} else {
+			throw new ServiceException("Service: " + _serviceName + " is not refreshable");
+		}
+	}
+	
+	public abstract void stop() throws ServiceException;
+
+}

Property changes on: src/edu/ucsb/nceas/metacat/shared/BaseService.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/shared/BaseDAO.java
===================================================================
--- src/edu/ucsb/nceas/metacat/shared/BaseDAO.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/shared/BaseDAO.java	(revision 5015)
@@ -0,0 +1,70 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A Class that holds the data from the scheduled_task 
+ *             table in the database. 
+ *  Copyright: 2009 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Michael Daigle
+ * 
+ *   '$Author: daigle $'
+ *     '$Date: 2009-03-23 13:56:56 -0800 (Mon, 23 Mar 2009) $'
+ * '$Revision: 4854 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+package edu.ucsb.nceas.metacat.shared;
+
+import java.sql.Timestamp;
+
+public class BaseDAO {
+	
+	private Long _id;
+	private Timestamp _createTime;
+	private Timestamp _modTime;
+	private String _status;
+	
+	public Long getId() {
+		return _id;
+	}
+	
+	public void setId(Long id) {
+		_id = id;
+	}
+	
+	public Timestamp getCreateTime() {
+		return _createTime;
+	}
+	
+	public void setCreateTime(Timestamp createTime) {
+		_createTime = createTime;
+	}
+	
+	public Timestamp getModTime() {
+		return _modTime;
+	}
+	
+	public void setModTime(Timestamp modTime) {
+		_modTime = modTime;
+	}
+	
+	public String getStatus() {
+		return _status;
+	}
+	
+	public void setStatus(String status) {
+		_status = status;
+	}
+	
+}
\ No newline at end of file

Property changes on: src/edu/ucsb/nceas/metacat/shared/BaseDAO.java
___________________________________________________________________
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/Sitemap.java
===================================================================
--- src/edu/ucsb/nceas/metacat/Sitemap.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/Sitemap.java	(revision 5015)
@@ -35,6 +35,8 @@
 
 import org.apache.log4j.Logger;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/admin/GeoserverAdmin.java
===================================================================
--- src/edu/ucsb/nceas/metacat/admin/GeoserverAdmin.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/admin/GeoserverAdmin.java	(revision 5015)
@@ -37,9 +37,9 @@
 import org.apache.log4j.Logger;
 
 import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.GeoserverUtil;
 import edu.ucsb.nceas.metacat.util.RequestUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
 
 /**
Index: src/edu/ucsb/nceas/metacat/Eml200SAXHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/Eml200SAXHandler.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/Eml200SAXHandler.java	(revision 5015)
@@ -48,6 +48,8 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.util.AuthUtil;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
Index: src/edu/ucsb/nceas/metacat/DocumentIdentifier.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DocumentIdentifier.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DocumentIdentifier.java	(revision 5015)
@@ -31,6 +31,8 @@
 import java.lang.*;
 import java.sql.*;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 
Index: src/edu/ucsb/nceas/metacat/scheduler/SchedulerService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/scheduler/SchedulerService.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/scheduler/SchedulerService.java	(revision 5015)
@@ -41,9 +41,9 @@
 import org.quartz.Trigger;
 import org.quartz.TriggerUtils;
 
-import edu.ucsb.nceas.metacat.service.BaseService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
-import edu.ucsb.nceas.shared.AccessException;
+import edu.ucsb.nceas.metacat.shared.AccessException;
+import edu.ucsb.nceas.metacat.shared.BaseService;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.utilities.DateUtil;
 import edu.ucsb.nceas.utilities.StatusUtil;
 import edu.ucsb.nceas.utilities.UtilException;
Index: src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobParamAccess.java
===================================================================
--- src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobParamAccess.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobParamAccess.java	(revision 5015)
@@ -39,9 +39,9 @@
 
 import org.apache.log4j.Logger;
 
-import edu.ucsb.nceas.metacat.DBConnectionPool;
-import edu.ucsb.nceas.shared.AccessException;
-import edu.ucsb.nceas.shared.BaseAccess;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+import edu.ucsb.nceas.metacat.shared.AccessException;
+import edu.ucsb.nceas.metacat.shared.BaseAccess;
 import edu.ucsb.nceas.utilities.StatusUtil;
 
 public class ScheduledJobParamAccess extends BaseAccess {
Index: src/edu/ucsb/nceas/metacat/database/DatabaseService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/database/DatabaseService.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/database/DatabaseService.java	(revision 5015)
@@ -0,0 +1,109 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: A Class that implements database utility methods 
+ *  Copyright: 2008 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Michael Daigle
+ * 
+ *   '$Author: daigle $'
+ *     '$Date: 2008-08-22 16:23:38 -0700 (Fri, 22 Aug 2008) $'
+ * '$Revision: 4297 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.database;
+
+import org.apache.log4j.Logger;
+
+import edu.ucsb.nceas.dbadapter.AbstractDatabase;
+import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.shared.BaseService;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
+
+public class DatabaseService extends BaseService {
+	
+	private static DatabaseService databaseService = null;
+	private static AbstractDatabase dbAdapter;	
+	private static Logger logMetacat = Logger.getLogger(DatabaseService.class);
+
+	/**
+	 * private constructor since this is a singleton
+	 */
+	private DatabaseService() {
+    	// Determine our db adapter class and create an instance of that class
+        try {
+            dbAdapter = (AbstractDatabase) createObject(PropertyService.getProperty("database.adapter"));
+        } catch (Exception e) {
+            logMetacat.error("Could not create dbAdaptor" + e.getMessage());
+            e.printStackTrace();
+        }
+	}
+	
+	/**
+	 * Get the single instance of DatabaseService.
+	 * 
+	 * @return the single instance of DatabaseService
+	 */
+	public static DatabaseService getInstance() {
+		if (databaseService == null) {
+			databaseService = new DatabaseService();
+		}
+		return databaseService;
+	}
+	
+	public boolean refreshable() {
+		return false;
+	}
+	
+	public void doRefresh() throws ServiceException {
+		return;
+	}
+	
+	public void stop() throws ServiceException {
+		return;
+	}
+	
+    /**
+	 * Instantiate a class using the name of the class at runtime
+	 *
+	 * @param className the fully qualified name of the class to instantiate
+	 */
+	public static Object createObject(String className) throws Exception {
+
+		Object object = null;
+		try {
+			Class classDefinition = Class.forName(className);
+			object = classDefinition.newInstance();
+		} catch (InstantiationException e) {
+			throw e;
+		} catch (IllegalAccessException e) {
+			throw e;
+		} catch (ClassNotFoundException e) {
+			throw e;
+		}
+		return object;
+	}
+	
+	/**
+	 * gets the database adapter
+	 * 
+	 * @return AbstractDatabase object for this application's database adapter.
+	 */
+	public static AbstractDatabase getDBAdapter() {
+		return dbAdapter;
+	}
+
+}

Property changes on: src/edu/ucsb/nceas/metacat/database/DatabaseService.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/shared/BaseException.java
===================================================================
--- src/edu/ucsb/nceas/metacat/shared/BaseException.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/shared/BaseException.java	(revision 5015)
@@ -0,0 +1,71 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: An Exception thrown when an error occurs because an 
+ *             AccessionNumber was invalid or used incorrectly
+ *  Copyright: 2008 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Michael Daigle
+ *
+ *   '$Author: daigle $'
+ *     '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
+ * '$Revision: 4080 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.shared;
+
+/**
+ * Exception thrown when an error occurs in a configuration administrative
+ * class
+ */
+public class BaseException extends Exception {
+
+
+	private static final long serialVersionUID = 1331212806605660813L;
+	
+	private static String _coreMessage;
+	
+	/**
+	 * Create a new AccessException.
+	 *
+	 * @param message The error or warning message.
+	 */
+	public BaseException(String message) {
+		super(message);
+		_coreMessage = message;
+	}
+	
+	/**
+	 * Create a new BaseException.
+	 *
+	 * @param message The error or warning message.
+	 */
+	public BaseException(String message, BaseException deeperException) {
+		super(message + " --> " + deeperException.getMessage());
+		_coreMessage = deeperException.getCoreMessage();
+	}
+	
+	public String getCoreMessage() {
+		return _coreMessage;
+	}
+	
+	public void setCoreMessage(String coreMessage) {
+		_coreMessage = coreMessage;
+	}
+	
+
+
+}

Property changes on: src/edu/ucsb/nceas/metacat/shared/BaseException.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/shared/HandlerException.java
===================================================================
--- src/edu/ucsb/nceas/metacat/shared/HandlerException.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/shared/HandlerException.java	(revision 5015)
@@ -0,0 +1,46 @@
+/**
+ *  '$RCSfile$'
+ *    Purpose: An Exception thrown when an error occurs because an 
+ *             AccessionNumber was invalid or used incorrectly
+ *  Copyright: 2008 Regents of the University of California and the
+ *             National Center for Ecological Analysis and Synthesis
+ *    Authors: Michael Daigle
+ *
+ *   '$Author: daigle $'
+ *     '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
+ * '$Revision: 4080 $'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+package edu.ucsb.nceas.metacat.shared;
+
+/**
+ * Exception thrown when an error occurs in a configuration administrative
+ * class
+ */
+public class HandlerException extends Exception {
+
+	private static final long serialVersionUID = 7997030775672963304L;
+
+	/**
+	 * Create a new AdminException.
+	 *
+	 * @param message The error or warning message.
+	 */
+	public HandlerException(String message) {
+		super(message);
+	}
+}

Property changes on: src/edu/ucsb/nceas/metacat/shared/HandlerException.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mergeinfo
## -0,0 +0,0 ##
Index: src/edu/ucsb/nceas/metacat/DBSAXHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBSAXHandler.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBSAXHandler.java	(revision 5015)
@@ -35,6 +35,8 @@
 import java.util.Stack;
 import java.util.Vector;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
 import edu.ucsb.nceas.metacat.service.PropertyService;
 import edu.ucsb.nceas.metacat.service.XMLSchema;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
Index: src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java
===================================================================
--- src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java	(revision 5015)
@@ -35,11 +35,11 @@
 
 import org.apache.log4j.Logger;
 
-import edu.ucsb.nceas.metacat.DBVersion;
 import edu.ucsb.nceas.metacat.MetaCatVersion;
+import edu.ucsb.nceas.metacat.database.DBVersion;
 import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.service.ServiceException;
 import edu.ucsb.nceas.metacat.service.ServiceService;
+import edu.ucsb.nceas.metacat.shared.ServiceException;
 import edu.ucsb.nceas.metacat.util.RequestUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
 
Index: src/edu/ucsb/nceas/metacat/admin/DBAdmin.java
===================================================================
--- src/edu/ucsb/nceas/metacat/admin/DBAdmin.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/admin/DBAdmin.java	(revision 5015)
@@ -50,15 +50,15 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
-import edu.ucsb.nceas.metacat.DBConnection;
-import edu.ucsb.nceas.metacat.DBConnectionPool;
-import edu.ucsb.nceas.metacat.DBVersion;
 import edu.ucsb.nceas.metacat.MetaCatVersion;
+import edu.ucsb.nceas.metacat.database.DBConnection;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+import edu.ucsb.nceas.metacat.database.DBVersion;
 import edu.ucsb.nceas.metacat.service.PropertyService;
+import edu.ucsb.nceas.metacat.shared.MetacatUtilException;
 import edu.ucsb.nceas.metacat.util.DatabaseUtil;
 import edu.ucsb.nceas.metacat.util.RequestUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
-import edu.ucsb.nceas.metacat.util.MetacatUtilException;
 
 import edu.ucsb.nceas.utilities.DBUtil;
 import edu.ucsb.nceas.utilities.FileUtil;
Index: src/edu/ucsb/nceas/metacat/DBDTDHandler.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBDTDHandler.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/DBDTDHandler.java	(revision 5015)
@@ -29,6 +29,8 @@
 
 import org.xml.sax.*;
 
+import edu.ucsb.nceas.metacat.database.DBConnection;
+
 import java.sql.*;
 import java.net.URL;
 import java.net.MalformedURLException;
Index: src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobDAO.java
===================================================================
--- src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobDAO.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobDAO.java	(revision 5015)
@@ -30,7 +30,7 @@
 import java.sql.Timestamp;
 import java.util.HashMap;
 
-import edu.ucsb.nceas.shared.BaseDAO;
+import edu.ucsb.nceas.metacat.shared.BaseDAO;
 
 public class ScheduledJobDAO extends BaseDAO {
 	
Index: src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobAccess.java
===================================================================
--- src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobAccess.java	(revision 5014)
+++ src/edu/ucsb/nceas/metacat/scheduler/ScheduledJobAccess.java	(revision 5015)
@@ -38,9 +38,9 @@
 import org.apache.log4j.Logger;
 import org.quartz.Job;
 
-import edu.ucsb.nceas.metacat.DBConnectionPool;
-import edu.ucsb.nceas.shared.AccessException;
-import edu.ucsb.nceas.shared.BaseAccess;
+import edu.ucsb.nceas.metacat.database.DBConnectionPool;
+import edu.ucsb.nceas.metacat.shared.AccessException;
+import edu.ucsb.nceas.metacat.shared.BaseAccess;
 import edu.ucsb.nceas.utilities.StatusUtil;
 
 public class ScheduledJobAccess extends BaseAccess {
