'This will create the connection if needed so should not fail.'

@utils.Synchronized
def Get(self, subject):

    (filename, directory) = common.ResolveSubjectDestination(subject, self.path_regexes)
    key = common.MakeDestinationKey(directory, filename)
    try:
        return super(SqliteConnectionCache, self).Get(key)
    except KeyError:
        dirname = utils.JoinPath(self.root_path, directory)
        path = (utils.JoinPath(dirname, filename) + SQLITE_EXTENSION)
        dirname = utils.SmartStr(dirname)
        path = utils.SmartStr(path)
        if (not os.path.isdir(dirname)):
            try:
                os.makedirs(dirname)
            except OSError:
                pass
        self._EnsureDatabaseExists(path)
        connection = SqliteConnection(path)
        super(SqliteConnectionCache, self).Put(key, connection)
        return connection
