You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org> on 2006/04/03 15:49:44 UTC

[jira] Created: (DERBY-1176) Stored prepared statements in the SYSIBM schema are not updated on upgrade

Stored prepared statements in the SYSIBM schema are not updated on upgrade
--------------------------------------------------------------------------

         Key: DERBY-1176
         URL: http://issues.apache.org/jira/browse/DERBY-1176
     Project: Derby
        Type: Bug

  Components: JDBC  
    Versions: 10.2.0.0    
    Reporter: Knut Anders Hatlen
 Assigned to: Knut Anders Hatlen 


When upgrading a database created with Derby 10.1 to 10.2, the SPSs in
the SYSIBM schema are not updated. SYSIBM.METADATA was modified in
DERBY-965, but it still has the old behaviour after the upgrade (both soft and
hard).

How to reproduce:

  1. Create a database with 10.1.

    soft upgrade:

  2. Start 10.2 network server.
  3. Connect to the 10.1 database with the 10.2 client driver and
     invoke DatabaseMetaData.supportsResultSetConcurrency(
     ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
     value: FALSE.

    hard upgrade:

  4. Restart 10.2 network server.
  5. Connect to the database with "upgrade=true" added to the
     URL. DatabaseMetaData.supportsResultSetConcurrency(
     Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY) returns
     FALSE.

    observe correct behaviour:

  6. Delete the database and recreate it with 10.2.
  7. Start 10.2 network server.
  8. Connect to the database with the client driver and invoke
     DatabaseMetaData.supportsResultSetConcurrency(
     Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
     value: TRUE.

Proposed solution for hard upgrade: drop and recreate SPSs.

Proposed solution for soft upgrade: read SYSIBM.METADATA from
metadata_net.properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1176) Stored prepared statements in the SYSIBM schema are not updated on upgrade

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1176?page=all ]

Knut Anders Hatlen updated DERBY-1176:
--------------------------------------

    Attachment: derby-1176-v1.diff
                derby-1176-v1.stat

'derby-1176-v1.diff' makes the metadata calls that depend on
SYSIBM.METADATA return the correct results after an upgrade from 10.1
(soft or hard).

  1. DD_Version.doFullUpgrade() now drops and recreates SPSs in all
     system schemas, not SYSIBM only.

  2. EmbedDatabaseMetaData already has the necessary machinery to load
     queries from system tables or metadata.properties depending on
     whether the engine is in soft upgrade mode or not. I extended it
     so that it could read queries from metadata_net.properties as
     well.

  3. New method EmbedDatabaseMetaData.getClientCachedMetaData() which
     executes SYSIBM.METADATA (either from system table or
     metadata_net.properties) to fetch the metadata that will be
     cached on the client.

  4. SystemProcedures.METADATA() now invokes
     EmbedDatabaseMetaData.getClientCachedMetaData() instead of
     executing the METADATA SPS directly.

The patch passes derbyall and the upgrade test. I have verified
manually that the metadata calls on the client return the correct
values in soft and hard upgrade.

Please review. Thanks.

> Stored prepared statements in the SYSIBM schema are not updated on upgrade
> --------------------------------------------------------------------------
>
>          Key: DERBY-1176
>          URL: http://issues.apache.org/jira/browse/DERBY-1176
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Versions: 10.2.0.0
>     Reporter: Knut Anders Hatlen
>     Assignee: Knut Anders Hatlen
>  Attachments: derby-1176-v1.diff, derby-1176-v1.stat
>
> When upgrading a database created with Derby 10.1 to 10.2, the SPSs in
> the SYSIBM schema are not updated. SYSIBM.METADATA was modified in
> DERBY-965, but it still has the old behaviour after the upgrade (both soft and
> hard).
> How to reproduce:
>   1. Create a database with 10.1.
>     soft upgrade:
>   2. Start 10.2 network server.
>   3. Connect to the 10.1 database with the 10.2 client driver and
>      invoke DatabaseMetaData.supportsResultSetConcurrency(
>      ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: FALSE.
>     hard upgrade:
>   4. Restart 10.2 network server.
>   5. Connect to the database with "upgrade=true" added to the
>      URL. DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY) returns
>      FALSE.
>     observe correct behaviour:
>   6. Delete the database and recreate it with 10.2.
>   7. Start 10.2 network server.
>   8. Connect to the database with the client driver and invoke
>      DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: TRUE.
> Proposed solution for hard upgrade: drop and recreate SPSs.
> Proposed solution for soft upgrade: read SYSIBM.METADATA from
> metadata_net.properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1176) Stored prepared statements in the SYSIBM schema are not updated on upgrade

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1176?page=all ]

Knut Anders Hatlen updated DERBY-1176:
--------------------------------------

    Derby Info: [Patch Available]

> Stored prepared statements in the SYSIBM schema are not updated on upgrade
> --------------------------------------------------------------------------
>
>          Key: DERBY-1176
>          URL: http://issues.apache.org/jira/browse/DERBY-1176
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Versions: 10.2.0.0
>     Reporter: Knut Anders Hatlen
>     Assignee: Knut Anders Hatlen
>  Attachments: derby-1176-v1.diff, derby-1176-v1.stat
>
> When upgrading a database created with Derby 10.1 to 10.2, the SPSs in
> the SYSIBM schema are not updated. SYSIBM.METADATA was modified in
> DERBY-965, but it still has the old behaviour after the upgrade (both soft and
> hard).
> How to reproduce:
>   1. Create a database with 10.1.
>     soft upgrade:
>   2. Start 10.2 network server.
>   3. Connect to the 10.1 database with the 10.2 client driver and
>      invoke DatabaseMetaData.supportsResultSetConcurrency(
>      ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: FALSE.
>     hard upgrade:
>   4. Restart 10.2 network server.
>   5. Connect to the database with "upgrade=true" added to the
>      URL. DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY) returns
>      FALSE.
>     observe correct behaviour:
>   6. Delete the database and recreate it with 10.2.
>   7. Start 10.2 network server.
>   8. Connect to the database with the client driver and invoke
>      DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: TRUE.
> Proposed solution for hard upgrade: drop and recreate SPSs.
> Proposed solution for soft upgrade: read SYSIBM.METADATA from
> metadata_net.properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DERBY-1176) Stored prepared statements in the SYSIBM schema are not updated on upgrade

Posted by Oystein Grovlen - Sun Norway <Oy...@Sun.COM>.
Dag H. Wanvik (JIRA) wrote:

> Minor nit-picks:
> 
> - EmbedDatabaseMetaData.java
> 
>   * Code readability:
>   
>   if ((removeSYSIBMonly && isSYSIBM) || !removeSYSIBMonly) {
>      <do something>
>   }
> 
>   might be more readable as:
> 
>   if (removeSYSIBMonly && !isSYSIBM) {
>        // do nothing
>   } else {
>        <do something>
>   }
> 

Another and IMHO even more readable alternative is:

if (isSYSIBM || !removeSYSIBMonly) {
       <do something>
}


-- 
Øystein

[jira] Commented: (DERBY-1176) Stored prepared statements in the SYSIBM schema are not updated on upgrade

Posted by "Dag H. Wanvik (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1176?page=comments#action_12375145 ] 

Dag H. Wanvik commented on DERBY-1176:
--------------------------------------

Nice patch! I think the approach is sound; without it some metadata
changed for client SUR will be wrong on both soft and hard upgrade, so
thanks for this.

Minor nit-picks:

- EmbedDatabaseMetaData.java

  * Code readability:
  
  if ((removeSYSIBMonly && isSYSIBM) || !removeSYSIBMonly) {
     <do something>
  }

  might be more readable as:

  if (removeSYSIBMonly && !isSYSIBM) {
       // do nothing
  } else {
       <do something>
  }

  * Some comments mention only metadata.properties which should now
    also mention metadata_net.properties, e.g. on ca line 3339:

    //Can't use stored prepared statements because we are in soft upgrade
    //mode and hence need to get metadata sql from metadata.properties file 
 
    Similarly, the javadoc for getPreparedQuery also mentions
    metadata.properties in its description, but only introduces
    metadata_net.properties when explaining the parameters. There are
    other similar instances.

  * Specialized version (non-client) of getPreparedQuery and
    getSimpleQuery have been introduced with protected visibility.
    The general ones can now be made private (at least for now).


> Stored prepared statements in the SYSIBM schema are not updated on upgrade
> --------------------------------------------------------------------------
>
>          Key: DERBY-1176
>          URL: http://issues.apache.org/jira/browse/DERBY-1176
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Versions: 10.2.0.0
>     Reporter: Knut Anders Hatlen
>     Assignee: Knut Anders Hatlen
>  Attachments: derby-1176-v1.diff, derby-1176-v1.stat
>
> When upgrading a database created with Derby 10.1 to 10.2, the SPSs in
> the SYSIBM schema are not updated. SYSIBM.METADATA was modified in
> DERBY-965, but it still has the old behaviour after the upgrade (both soft and
> hard).
> How to reproduce:
>   1. Create a database with 10.1.
>     soft upgrade:
>   2. Start 10.2 network server.
>   3. Connect to the 10.1 database with the 10.2 client driver and
>      invoke DatabaseMetaData.supportsResultSetConcurrency(
>      ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: FALSE.
>     hard upgrade:
>   4. Restart 10.2 network server.
>   5. Connect to the database with "upgrade=true" added to the
>      URL. DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY) returns
>      FALSE.
>     observe correct behaviour:
>   6. Delete the database and recreate it with 10.2.
>   7. Start 10.2 network server.
>   8. Connect to the database with the client driver and invoke
>      DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: TRUE.
> Proposed solution for hard upgrade: drop and recreate SPSs.
> Proposed solution for soft upgrade: read SYSIBM.METADATA from
> metadata_net.properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1176) Stored prepared statements in the SYSIBM schema are not updated on upgrade

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1176?page=all ]

Knut Anders Hatlen updated DERBY-1176:
--------------------------------------

    Attachment: derby-1176-v2.diff
                derby-1176-v2.stat

Thanks, Dag and Øystein, for your comments! I have uploaded a new patch with the modifications you suggested. Since I had problems deciding which elegant rewrite of the if statement I should choose, I chose a hybrid and added comments to clarify.

The upgrade test still runs cleanly, and my manual test of the client/metadata issue passes too. Have started a derbyall run now, just in case. If there are no more comments, I will commit the patch tomorrow.

> Stored prepared statements in the SYSIBM schema are not updated on upgrade
> --------------------------------------------------------------------------
>
>          Key: DERBY-1176
>          URL: http://issues.apache.org/jira/browse/DERBY-1176
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Versions: 10.2.0.0
>     Reporter: Knut Anders Hatlen
>     Assignee: Knut Anders Hatlen
>  Attachments: derby-1176-v1.diff, derby-1176-v1.stat, derby-1176-v2.diff, derby-1176-v2.stat
>
> When upgrading a database created with Derby 10.1 to 10.2, the SPSs in
> the SYSIBM schema are not updated. SYSIBM.METADATA was modified in
> DERBY-965, but it still has the old behaviour after the upgrade (both soft and
> hard).
> How to reproduce:
>   1. Create a database with 10.1.
>     soft upgrade:
>   2. Start 10.2 network server.
>   3. Connect to the 10.1 database with the 10.2 client driver and
>      invoke DatabaseMetaData.supportsResultSetConcurrency(
>      ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: FALSE.
>     hard upgrade:
>   4. Restart 10.2 network server.
>   5. Connect to the database with "upgrade=true" added to the
>      URL. DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY) returns
>      FALSE.
>     observe correct behaviour:
>   6. Delete the database and recreate it with 10.2.
>   7. Start 10.2 network server.
>   8. Connect to the database with the client driver and invoke
>      DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: TRUE.
> Proposed solution for hard upgrade: drop and recreate SPSs.
> Proposed solution for soft upgrade: read SYSIBM.METADATA from
> metadata_net.properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-1176) Stored prepared statements in the SYSIBM schema are not updated on upgrade

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1176?page=all ]
     
Knut Anders Hatlen closed DERBY-1176:
-------------------------------------

    Fix Version: 10.2.0.0
     Resolution: Fixed

Committed revision 395799.

> Stored prepared statements in the SYSIBM schema are not updated on upgrade
> --------------------------------------------------------------------------
>
>          Key: DERBY-1176
>          URL: http://issues.apache.org/jira/browse/DERBY-1176
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Versions: 10.2.0.0
>     Reporter: Knut Anders Hatlen
>     Assignee: Knut Anders Hatlen
>      Fix For: 10.2.0.0
>  Attachments: derby-1176-v1.diff, derby-1176-v1.stat, derby-1176-v2.diff, derby-1176-v2.stat
>
> When upgrading a database created with Derby 10.1 to 10.2, the SPSs in
> the SYSIBM schema are not updated. SYSIBM.METADATA was modified in
> DERBY-965, but it still has the old behaviour after the upgrade (both soft and
> hard).
> How to reproduce:
>   1. Create a database with 10.1.
>     soft upgrade:
>   2. Start 10.2 network server.
>   3. Connect to the 10.1 database with the 10.2 client driver and
>      invoke DatabaseMetaData.supportsResultSetConcurrency(
>      ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: FALSE.
>     hard upgrade:
>   4. Restart 10.2 network server.
>   5. Connect to the database with "upgrade=true" added to the
>      URL. DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY) returns
>      FALSE.
>     observe correct behaviour:
>   6. Delete the database and recreate it with 10.2.
>   7. Start 10.2 network server.
>   8. Connect to the database with the client driver and invoke
>      DatabaseMetaData.supportsResultSetConcurrency(
>      Restart.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY). Return
>      value: TRUE.
> Proposed solution for hard upgrade: drop and recreate SPSs.
> Proposed solution for soft upgrade: read SYSIBM.METADATA from
> metadata_net.properties.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira