new (Vapor::RepositoryManager)

    # File vapor/repositorymgr.rb, line 127
        def initialize( db_spec, user, pass, check_repository = true )
          raise TypeError unless db_spec.is_a? String and user.is_a? String and pass.is_a? String

          # check for validity of database-specifier
          database = db_spec.split(':')
          raise TypeError, "invalid db_spec" unless database.size == 3 or database.size == 4
          raise TypeError, "invalid database driver" unless database[0] == 'pg' # currently only know PostgreSQL

          # connect to database
          driver_url = database.unshift( 'DBI' ).join(':')
          begin
            @dbh = DBI.connect( driver_url, user, pass )
          rescue DBI::OperationalError => e
            raise RepositoryOfflineError, e.message
          end

          # check PostgreSQL version
          @psql_version = @dbh.execute('SELECT version()').fetch[0]
          @psql_version = /^PostgreSQL ([\d\.]+)/.match( @psql_version )[1]

          # initialize some instance variables
          @known_klasses = nil
          @oid_gen = OIDGenerator.new
          @oid_gen.high_source = self
          @repository_ok = false

          # silence PostgreSQL >= 7.3 when creating tables
          if @psql_version >= "7.3" then
            @dbh.execute( 'SET CLIENT_MIN_MESSAGES TO ERROR ' )
          end

          # make sure that the database looks like a repository
          return if !check_repository

          result = @dbh.execute( "SELECT  relname FROM pg_class WHERE relname LIKE ':Vapor::%' AND relkind = 'r'")
          result = result.fetch_all
          if result.size != 5 then
            raise BackendInconsistentError, "database does not seem to be a valid repository,"
          else
            result.each{|row|
              if ![":Vapor::AttributeMetaData",":Vapor::ClassMetaData",":Vapor::ObjectList", ":Vapor::RepositoryInfo", ":Vapor::TransactionLog"].include? row[0] then
                raise BackendInconsistentError, "database does not seem to be a valid repository"
              end
            }
          end
          @repository_ok = true

        end