Right.  I agree with statements in general can be shared across different connections.
I was just trying to say that in some cases, the GenericStatement equals()
method will return false for object equality comparison when the compilationSchema is different and thus will not be able to utilize the statement cache.

public boolean equals(Object other) {

        if (other instanceof GenericStatement) {
            GenericStatement os = (GenericStatement) other;

            return statementText.equals(os.statementText ) && isForReadOnly==os.isForReadOnly
                && compilationSchema.equals(os.compilationSchema) &&
                (prepareIsolationLevel == os.prepareIsolationLevel);

        return false;

On 9/1/06, Daniel John Debrunner <djd@apache.org> wrote:
Yip Ng (JIRA) wrote:

> With the current logic of the statement cache, the compiled grant/revoke statement
> will not be reused for different connections since I think the equals method is checking if the
> statement's  compilation schema is the same.  Just an implementation note.

Do not equate different connections with different schemas.

There can be multiple connections that have the same current schema and
they could all have different user identifiers associated with them.

The basic rule is that statements are meant to be shared. The
GRANT/REVOKE statements are sharable and can be used by different