public void shutdown() throws DataSourceException {
  if (createdSessionFactory) {
    if (sessionFactory != null && !sessionFactory.isClosed()) {
      try {
        sessionFactory.close();
      }
  finally {
        sessionFactory=null;
      }
    }
  }
}

public void shutdown ( ) throws DataSourceException { if ( createdSessionFactory ) { if ( sessionFactory != null && ! sessionFactory . isClosed ( ) ) { try { sessionFactory . close ( ) ; } finally { sessionFactory = null ; } } } }
shuts down the data source . if the session factory was created by this data source , will close it .
