db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David W. Van Couvering" <David.Vancouver...@Sun.COM>
Subject Re: [jira] Updated: (DERBY-289) Enable code sharing between Derby client and engine
Date Wed, 16 Nov 2005 18:42:10 GMT
Great, thanks for your very great analysis, Deepa!  I'll fix these bugs.

David

Deepa Remesh wrote:
> On 11/15/05, David Van Couvering <David.Vancouvering@sun.com> wrote:
> 
> 
>>In the meantime, let's focus on the issue you encountered.  It's funny,
>>the error isn't that the message id was not found.  Instead, we weren't
>>able to find org.apache.derby.loc.client-messages.properties.
> 
> 
> I think this is because the bundle name in ClientMessageUtil has
> ".properties" at the end. ResourceBundle.getBundle expects a class
> name or resource file name without the ".properties".
> 
> private static final String CLIENT_BUNDLE_NAME =  
> "org.apache.derby.loc.client-messages.properties";
> 
> I changed this to "org.apache.derby.loc.client-messages" and it did
> not complain about missing resource file. However it did not find the
> message in any of the resource files and it gave me the following
> message:
> 07000.new : [0] 1
> 
> So the code was actually looking for new message (07000.new). I was
> thinking the code was looking for the old message(07000) and should
> have found it in common-messages_en.properties file. The following
> code which checks if feature is available is not returning the
> expected value when jar versions are mixed:
> 
>             if (!parameterSet_[i] && !parameterRegistered_[i]) {
>                        CommonInfo cInfo = new CommonInfo();
>                        if(cInfo.hasFeature(CommonFeatures.SQLSTATE_07000_NEW))
>                                throw new SqlException2(agent_.logWriter_,
> SQLState.LANG_MISSING_PARMS2, new Integer (i));
>                        else
>                                throw new SqlException2(agent_.logWriter_,
> SQLState.LANG_MISSING_PARMS);
>                }
> 
> 
> In the mixed jar environment (where I have old derby.jar and new
> derbyclient.jar), "hasFeature(CommonFeatures.SQLSTATE_07000_NEW)"
> returns true.
> I looked in derby.jar and it does not have CommonInfo class. So this
> class gets picked from (new) derbyclient.jar, which has this feature
> implemented and hence this method returns true.
> 
> Thanks,
> Deepa

Mime
View raw message