db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yip Ng" <yipng...@gmail.com>
Subject Re: [jira] Commented: (DERBY-1686) Grant/Revoke: Attempt to GRANT access to another user on a VIEW, created by the current user with only SELECT privilege on the base table does not fail
Date Fri, 01 Sep 2006 21:15:11 GMT
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
> connections.
>
> Dan.
>
>
>
>

Mime
View raw message