db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: procedure to upgrade or create an embedded database
Date Tue, 09 Dec 2008 13:55:19 GMT
Hi Brian,

Specifying "upgrade=true" on an already upgraded database should be 
harmless. Here's how to determine if the database needs to be upgraded:

1) The database needs to be upgraded if the (two digit) on-disk version 
of the database is less than the leading two digits of the Derby release 

2) The on-disk version of the database can be obtained by the following 
query. Note this is not part of Derby's public API and so could change 
in the future. However, this part of the API has remained stable for the 
last 4 years:

    values ( syscs_util.syscs_get_database_property( 
'DataDictionaryVersion' ) )

3) The release identifier can be obtained via sysinfo.

Hope this helps,

publicayers@verizon.net wrote:
> How do I tell if the database needs to be upgraded? Or is there no 
> impact if I specify "upgrade" but one is not necessary?
> Brian
> On Mon, Dec 8, 2008 at  8:43 AM, Rick Hillegas wrote:
>> Brian Peterson wrote:
>>> I'm trying to figure out how to determine what connection parameters 
>>> for an
>>> embedded database I should use when there might not be a database in 
>>> place
>>> (so "create=true"), or there might be an older version already in 
>>> place (so
>>> "upgrade=true"), or there might already be a database of the right 
>>> version
>>> in place (so "create" or add nothing to the URL).
>>> I read that "upgrade" and "create" cannot both be specified in the
>>> connection URL. If I'm putting out a release of my application that 
>>> uses the
>>> latest version of Derby (10.4) while a previous version used 10.2.2, 
>>> what
>>> are the recommended steps for making the connection to the Derby 
>>> database if
>>> one is already present? (Note that I have to handle this 
>>> programmatically as
>>> part of the application startup.)
>>> Do I first try a URL with "create" and see if there's an error, and 
>>> if so,
>>> follow up with a call with "upgrade"? Or do I have the procedure 
>>> always use
>>> "upgrade" and follow up with a URL with "create" if it fail to make a
>> Hi Brian,
>> Your first approach sounds good to me:
>> 1) Bring up the database, specifying "create=true"
>> 2) If you get the warning that the database already exists, then 
>> bring down the database and reboot it in upgrade mode
>> Regards,
>> -Rick
>>> connection?
>>> Brian

View raw message