From derby-commits-return-13071-apmail-db-derby-commits-archive=db.apache.org@db.apache.org Thu Sep 02 13:24:05 2010 Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 99926 invoked from network); 2 Sep 2010 13:24:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Sep 2010 13:24:05 -0000 Received: (qmail 73624 invoked by uid 500); 2 Sep 2010 13:24:05 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 73549 invoked by uid 500); 2 Sep 2010 13:24:03 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 73539 invoked by uid 99); 2 Sep 2010 13:24:02 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Sep 2010 13:24:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Sep 2010 13:23:44 +0000 Received: from eosnew.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 33FEFBDA for ; Thu, 2 Sep 2010 13:23:21 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Thu, 02 Sep 2010 13:23:21 -0000 Message-ID: <20100902132321.71053.354@eosnew.apache.org> Subject: =?utf-8?q?=5BDb-derby_Wiki=5D_Update_of_=22UpgradingTen=22_by_KatheyMarsd?= =?utf-8?q?en?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for = change notification. The "UpgradingTen" page has been changed by KatheyMarsden. http://wiki.apache.org/db-derby/UpgradingTen?action=3Ddiff&rev1=3D2&rev2=3D3 -------------------------------------------------- - =3D Upgrading Derby 10.0 to 10.1 =E2=80=93 Very Simple! =3D + =3D Upgrading Derby 10.x =E2=80=93 Very Simple! =3D =3D=3D Overview =3D=3D - Upgrading your application to use Derby 10.1 with an existing 10.0 databa= se is extremely easy. There are two options: + Upgrading your application to use a new Derby version with an existing 10= .x database is extremely easy. There are two options: - * Soft Upgrade - Use when your application is not changing but you want= to use the new version of Derby. - * Full Upgrade - Use when you want to take advantage of all of Derby 10= .1's new features! = - The [[http://db.apache.org/derby/releases/release-10.1.1.0.cgi|official D= erby 10.1 release]] is available at the [[http://db.apache.org/derby/derby_= downloads.html|Derby downloads]] page. These instructions, though, apply to= any 10.1 release, including the up-coming 10.1.2 bug fix release. + * Soft Upgrade - Use when your application is not changing but you want = to use the new version of Derby. + * Full Upgrade - Use when you want to take advantage of all of Derby ne= w features! + = + The latet Derby release is available at the [[http://db.apache.org/derby/= derby_downloads.html|Derby downloads]] page. These instructions, though, ap= ply to any 10.x release. = /!\ Taking a backup before an upgrade is a good precaution. = =3D=3D Soft Upgrade =3D=3D - = - Soft upgrade allows you to run your application with Derby 10.1 while lea= ving the option to revert to 10.0 should you discover any issues. + Soft upgrade allows you to run your application with an older Derby versi= on while leaving the option to revert should you discover any issues. = Three simple steps: = - 1. Shutdown the application running Derby + 1. Shutdown the application running Derby - 1. Change the application to use the Derby 10.1 jar files + 1. Change the application to use the new Derby jar files - * Either by changing the class path to point to the 10.1 jar files i= nstead of the 10.0 jar files, + * Either by changing the class path to point to the new jar files inst= ead of the previous 10.x jar files, - * Or replace all the 10.0 jar files the application is using with th= e 10.1 jar files. + * Or replace all the old derby jar files the application is using with = the new Derby jar files. - 1. Restart your application. + 1. Restart your application. = - That's it :-) , your application is now running using the 10.1 jar files. + That's it :-) , your application is now running using the new jar files. = - You may switch your application back to 10.0 at any time by following an = identical procedure, swapping 10.0 and 10.1. + You may switch your application back to at any time by following an iden= tical procedure, swapping the old jars for the new. It is perfectly fine to= skip versions and upgrade directly from 10.1 to 10.6 for instance and back= again from soft upgrade. = - =3D=3D=3D Selected 10.1 New Features =3D=3D=3D + =3D=3D=3D Selected New Features =3D=3D=3D + Soft upgrade does allow your application to use selected new features,and= take advantage of bug fixes, but obviously if you modify your application= to depend upon them, then application will no longer run against the previ= ous version. Generally, features can be used in soft upgrade if they don't= modify the system catalogs. For example in 10.6, you cannot use UDT's in = soft upgrade mode from a previous version, but the new CROSS JOIN syntax wi= ll work in soft upgrade. - = - Soft upgrade does allow your application to use selected new features, bu= t obviously if you modify your application to use them, then application wi= ll no longer run against 10.0. - = - The new features are: - = - * New open source Derby network client driver - * Support for J2ME/CDC/Foundation with JSR-169 JDBC subset - * XA support for Network Server - * Increased identifier lengths to 128 characters for all identifiers - * JDBC Updatable Result Sets - * ORDER by expressions - = = =3D=3D Full Upgrade =3D=3D - = - Full upgrade allows your application to take full advantage of Derby 10.1= 's new features, but means that you can no longer revert to 10.0 for the da= tabase. + Full upgrade allows your application to take full advantage of Derby new= features, but means that you can no longer revert to the previous Derby ve= rsion for the database. = Three simple steps: = - 1. Shutdown the application running Derby + 1. Shutdown the application running Derby - 1. Change the application to use the 10.1 jar files + 1. Change the application to use the new Derby jar files - * Either by changing the class path to point to the 10.1 jar files i= nstead of the 10.0 jar files, + * Either by changing the class path to point to the new Derby jar file= s instead of the Derby old jar files, - * Or replace all the 10.0 jar files the application is using with th= e 10.1 jar files. + * Or replace all the old Derby jar files the application is using wit= h the new jar files. - 1. Ensure that the first connection request includes the attribute upgr= ade set to true. + 1. Ensure that the first connection request includes the attribute upgra= de set to true. - * Either by connecting using ij with a JDBC URL like: {{{jdbc:derby:= mydb;upgrade=3Dtrue}}} + * Either by connecting using ij with a JDBC URL like: {{{jdbc:derby:myd= b;upgrade=3Dtrue}}} - * Or by running a simple Java JDBC program that connects to the data= base setting the {{{upgrade}}} attribute + * Or by running a simple Java JDBC program that connects to the databas= e setting the {{{upgrade}}} attribute - {{{ + . {{{ // Using JDBC URLs String dbURL =3D "jdbc:derby:mydb"; Properties connProps =3D new Properties(); connProps.put("upgrade", "true"); ... set any other properties Connection conn =3D DriverManager.getConnection(dbURL, connProps); - }}} + }}} - * Setting the Java Bean property for the Derby Data''''''Source {{{c= onnectionAttributes}}} to include {{{upgrade=3Dtrue}}} in its value. + * Setting the Java Bean property for the Derby DataSource {{{connection= Attributes}}} to include {{{upgrade=3Dtrue}}} in its value. - * Or by including an upgrade feature in your application that allows= the user to select upgrade and connects to the databse with the upgrade at= tibute. This application code would use one of the three methods above. + * Or by including an upgrade feature in your application that allows th= e user to select upgrade and connects to the databse with the upgrade attib= ute. This application code would use one of the three methods above. = - That's it :-) , your application is now running using the 10.1 jar files. + That's it :-) , your application is now running using the new Derby jar f= iles and can take full advantage of the new features. = - If you attempt to boot 10.0 against the database just upgraded, then the = boot will fail. + If you attempt to boot the old Derby version against the database was ju= st hard upgraded, then the boot will fail. + = {{{ ERROR XJ040: Failed to start database 'cs', see the next exception for de= tails. - ERROR XSLAN: Database at C:\_work\derby\cs has an incompatible format wit= h the current version of the software. The database was created by or upgr= aded by version 10.1. + ERROR XSLAN: Database at C:\_work\derby\cs has an incompatible format wit= h the current version of }}} = - = - =3D=3D=3D Enabled 10.1 New Features =3D=3D=3D - = - In addition to the features listed in Soft Upgrade, these new features ar= e enabled by full upgrade: - = - * Online compress functionality for reclaiming disk space during oper= ation - * Increased identifier lengths to 128 characters for all identifiers - * Added SQL: INTERSECT and EXCEPT - * Added SQL: SYNONYM - * Allow insertions into an identity column -=20