[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    Re: DO NOT REPLY [Bug 34343]  New:  -    revokePermission in PostgresRDBMSAdapter.java
From:       Martin_Kalén <mkalen () apache ! org>
Date:       2005-04-07 7:06:41
Message-ID: 4254DC01.4030806 () apache ! org
[Download RAW message or body]

bugzilla@apache.org wrote:
>                         if (revisionNumber == null)
>                                 statement = connection.prepareStatement(
>                                         "delete from PERMISSIONS where
> (OBJECT_ID, SUBJECT_ID, ACTION_ID) IN ( SELECT ou.URI_ID, su.URI_ID, au.URI_ID
> FROM URI ou, URI su, URI au WHERE ou.URI_STRING = ? and su.URI_STRING = ? and
> au.URI_STRING = ?) and VERSION_NO IS NULL");
>                         else
>                                 statement = connection.prepareStatement(
>                                         "delete from PERMISSIONS where
> (OBJECT_ID, SUBJECT_ID, ACTION_ID) IN ( SELECT ou.URI_ID, su.URI_ID, au.URI_ID
> FROM URI ou, URI su, URI au WHERE ou.URI_STRING = ? and su.URI_STRING = ? and
> au.URI_STRING = ?) and VERSION_NO = ?");

...which reminds me that the method used in CommonRDBMSAdapter, although
fixed since yesterday, is not very clever re PreparedStatement as it uses
a hardcoded revision number as parameter #4.

Eg suffix "and VERSION_NO = 1.0" vs "and VERSION_NO = 1.1" makes the statements
non-reusable although they are PreparedStatements.

My previous patch for CommonRDBMSAdapter sholud be adjusted in a similar fashion
as the PostgreSQL adapter above.

Regards,
  Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic