db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From myrna <my...@Golux.Com>
Subject Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource
Date Wed, 19 Jan 2005 19:42:46 GMT
Daniel John Debrunner wrote:

>Hash: SHA1
>myrna wrote:
>>It does no longer throw an NPE, and it passes all tests....
>>Could we leave EmbeddedDataSource alone & only change
>>EmbeddedXADataSource? Only with the xa datasource did we get a NPE...
>>Although strictly speaking, it should behave the same, so, with
>>EmbeddedDataSource too, we should accept the databasename only, it's
>>been able to resolve the url fine. I'd be apprehensive about any
>>possible cloudscape customers that have mistakenly used this
>I agree with Shreyas that his patch is logically correct but I want to
>ensure that your concerns are addressed. Can you be explicit about what
>you believe the patch breaks for existing users of Derby. I tried this
>and it results in a NullPointerException if the return from
>getConnection() is referenced, e.g. in the conn.close() here.
>(this is before the patch is applied)
>org.apache.derby.jdbc.EmbeddedDataSource ds = new
>Connection conn = ds.getConnection();
>// NPE here because conn is null
>The only issue I have with the patch is that the error thrown is
>misleading, "Database Not Available" implies to the user or application
>developer that they need to do something to make the database available.
>A database not found exception with the name obtained from
>DataSource.getDatabaseName() might make more sense. Or maybe even
>better, invalid property setting error, since databaseName is a Java
>Bean property of the datasource. E.g. SQLState.PROPERTY_INVALID_VALUE,
>resulting in an error like
>Invalid value for property 'databaseName'='jdbc:derby:fred'.
>Version: GnuPG v1.2.5 (MingW32)
>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
I see your point. My initial test case was overly simplistic - never 
actually did anything with the connection.


View raw message