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 "Myrna van Lunteren (JIRA)" <de...@db.apache.org> on 2004/12/08 00:17:08 UTC

[jira] Created: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

NPE when passing in url instead of database name to EmbeddedXADataSource
------------------------------------------------------------------------

         Key: DERBY-95
         URL: http://nagoya.apache.org/jira/browse/DERBY-95
     Project: Derby
        Type: Bug
  Components: JDBC  
    Reporter: Myrna van Lunteren
    Priority: Minor
     Fix For: 10.0.2.1


When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.

It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=history ]
     
Myrna van Lunteren resolved DERBY-95:
-------------------------------------

    Resolution: Fixed

(Visible to derby-developers)


> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1
>  Attachments: Derby-95.diff, Derby-95_latest.diff
>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DERBY-95?page=comments#action_56385 ]
     
Myrna van Lunteren commented on DERBY-95:
-----------------------------------------

stack from test case is:
java.lang.NullPointerException
java.lang.NullPointerException
	at org.apache.derby.jdbc.EmbeddedXADataSource.setupResourceAdapter(EmbeddedXADataSource.java)
	at org.apache.derby.jdbc.EmbeddedXADataSource.getXAConnection(EmbeddedXADataSource.java)
	at xaurl.runTests(xaurl.java:51)
	at xaurl.main(xaurl.java:26)



> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://nagoya.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1

>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57448 ]
     
Shreyas Kaushik commented on DERBY-95:
--------------------------------------

Agree with Dan's comments. Attaching the diff for the patching of this issue. 

The output with this patch will look like this, instead of throwing a NPE.

Exception in thread "main" java.sql.SQLException: Database not available

If this change is ok please accept the propsed patch.

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1
>  Attachments: Derby-95.diff
>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shreyas Kaushik (JIRA) wrote:

>      [
http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57371 ]
>
> Shreyas Kaushik commented on DERBY-95:
> --------------------------------------
>
> The EmbeddedXADataSource.getConnection() does not return null, the
call to this methods throws a NPE because the
EmbeddedDriver.getConnection() returns null and an attempt is made to
close the connection assuming that it will not return a null.


I was basing my comments on your first comment in Derby-95 that says the
EmbeddedXADataSource.getConnection() is returning null and the NPE
happens when the getConnection().close() is executed.
[by EmbeddedXADataSource.getConnection(), I mean the getConnection()
method that EmbeddedXADataSource inherits.]

Is this not the case?

> Here an NPE needs to be caught becuase the
EmbeddedDriver.getConnection can return null when
>
>   1) A database does not exist ( Url is valid

Is this true? I thought an exception was thrown if the database could
not be found.

>   2) The Url is invalid ( which is the case here )
>
>  After this NPE is caught we need to throw a SQLException saying that
the DB doesn't exist.
>
>  I hope everyone is ok with this approach, please comment and kindly
vote for the suggested fix.

In general code in Derby does not catch NPEs, but avoids them with
checks to see a reference is null before using it.

Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFB3ptJIv0S4qsbfuQRAoYPAJjgw0KtpMyE8Nj6Y6EgBmEujCJKAKDf6tpD
4yFQybYzB6PBc8L7TUAClQ==
=NwGv
-----END PGP SIGNATURE-----


[jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57371 ]
     
Shreyas Kaushik commented on DERBY-95:
--------------------------------------

The EmbeddedXADataSource.getConnection() does not return null, the call to this methods throws a NPE because the EmbeddedDriver.getConnection() returns null and an attempt is made to close the connection assuming that it will not return a null.

Here an NPE needs to be caught becuase the EmbeddedDriver.getConnection can return null when

  1) A database does not exist ( Url is valid )
  2) The Url is invalid ( which is the case here )

 After this NPE is caught we need to throw a SQLException saying that the DB doesn't exist. 
 
 I hope everyone is ok with this approach, please comment and kindly vote for the suggested fix.

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1

>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Volume of Data Supported

Posted by ruta kadhe <ru...@yahoo.com>.
Hi,
Can someone approximately specify how much volume of
data storage is supported by Derby in Embeded Mode to
provide an optimal performance.
Thanks,
Ruta


		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 

[jira] Updated: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=history ]

Shreyas Kaushik updated DERBY-95:
---------------------------------

    Attachment: Derby-95.diff

Proposed patch for fixing this

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1
>  Attachments: Derby-95.diff
>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DERBY-95?page=comments#action_57006 ]
     
Shreyas Kaushik commented on DERBY-95:
--------------------------------------

The part of the code that causes this NPE to come up is in the setupResourceAdapter method in the EmbeddedXADataSource.java, the fragment is here,

if (requestPassword) {
    getConnection(user, password).close();
}

Since the url passed is not a valid databaseName ( it considers the entire string as the database) it cannot establish a connection so the call to getConnection() returns null and calling close throws a NPE.

This can be resolved by checking if the connection handle returned by a call to the getConnection() method is null or not. If it is not null do the processing that is currently happening( closing of the connection in this case) , if it is null then throw a SQLException saying the database doesn't exist.

The same case also needs to be taken care of in the code fragment following the above code fragment as well.

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://nagoya.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1

>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DERBY-95?page=comments#action_57017 ]
     
Daniel John Debrunner commented on DERBY-95:
--------------------------------------------

I think the fix is a little more involved that Shreyas indicated.
getConnection() should not return null, so the getConnection().close() is correct. 

Investigation needs to be made as to why getConnection() is returning null, rather than throwing an exception.

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://nagoya.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1

>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=all ]

Myrna van Lunteren reassigned DERBY-95:
---------------------------------------

    Assign To: Shreyas Kaushik

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Assignee: Shreyas Kaushik
>     Priority: Minor
>      Fix For: 10.0.2.1
>  Attachments: Derby-95.diff, Derby-95_latest.diff
>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by myrna <my...@Golux.Com>.
Shreyas,

I like this message...The behavior is now fine with me. But now we don't 
need the imports to MessageID, ExceptionSeverity, and MessageService 
anymore, correct?

Also, do we feel this bug warrants a test case in one of the test 
suites? If so, it could maybe be added to 
org.apache.derbyTesting.functionTests.tests.jdbcapi.checkDataSource30 ? 
(I could do that).

Myrna


Shreyas Kaushik wrote:

> Here is the latest version of the patch with the aprropriate messages.
>
> thanks
> Shreyas
>
> Daniel John Debrunner wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> 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
>>> functionality...
>>>   
>>
>>
>> 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
>> org.apache.derby.jdbc.EmbeddedDataSource();
>>
>> ds.setDatabaseName("jdbc:derby:fred");
>>
>> Connection conn = ds.getConnection();
>>
>> // NPE here because conn is null
>> conn.close();
>>
>>
>> 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'.
>>
>> Thanks,
>> Dan.
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.2.5 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iD8DBQFB7rJnIv0S4qsbfuQRApTGAKDj+MxB4kOY/GNFCMs/9R5Js3zK2wCgqYSm
>> DrAWFRgPOfwMHin0vUwGi70=
>> =zL6e
>> -----END PGP SIGNATURE-----
>>
>>  
>>
>------------------------------------------------------------------------
>
>Index: java/engine/org/apache/derby/jdbc/EmbeddedDataSource.java
>===================================================================
>--- java/engine/org/apache/derby/jdbc/EmbeddedDataSource.java	(revision 125587)
>+++ java/engine/org/apache/derby/jdbc/EmbeddedDataSource.java	(working copy)
>@@ -34,6 +34,11 @@
> 
> 
> import org.apache.derby.iapi.reference.Attribute;
>+import org.apache.derby.iapi.reference.MessageId;
>+import org.apache.derby.iapi.reference.SQLState;
>+import org.apache.derby.iapi.error.ExceptionSeverity;
>+import org.apache.derby.iapi.services.i18n.MessageService;
>+import org.apache.derby.impl.jdbc.Util;
> 
> /** 
> 	
>@@ -431,6 +436,8 @@
> 	final Connection getConnection(String username, String password, boolean requestPassword)
> 		throws SQLException {
> 
>+        Connection toClose = null;
>+
> 		Properties info = new Properties();
> 		if (username != null)
> 			info.put(Attribute.USERNAME_ATTR, username);
>@@ -450,6 +457,7 @@
> 
> 		if (attributesAsPassword && requestPassword && password != null) {
> 
>+
> 			StringBuffer sb = new StringBuffer(url.length() + password.length() + 1);
> 
> 			sb.append(url);
>@@ -459,8 +467,12 @@
> 			url = sb.toString();
> 
> 		}
>+		toClose =  findDriver().connect(url, info);
> 
>-		return findDriver().connect(url, info);
>+        if(toClose == null)
>+           throw Util.generateCsSQLException(SQLState.PROPERTY_INVALID_VALUE,Attribute.DBNAME_ATTR,getDatabaseName());
>+
>+        return toClose;
> 	}
>    
> 	Driver169 findDriver() throws SQLException
>Index: java/engine/org/apache/derby/jdbc/EmbeddedXADataSource.java
>===================================================================
>--- java/engine/org/apache/derby/jdbc/EmbeddedXADataSource.java	(revision 125587)
>+++ java/engine/org/apache/derby/jdbc/EmbeddedXADataSource.java	(working copy)
>@@ -132,6 +132,9 @@
> 
> 	private void setupResourceAdapter(String user, String password, boolean requestPassword) throws SQLException
> 	{
>+
>+        Connection toClose = null;
>+
> 		synchronized(this)
> 		{
> 			if (ra == null || !ra.isActive())
>@@ -157,18 +160,24 @@
> 						// If database is not found, try connecting to it.  This
> 						// boots and/or creates the database.  If database cannot
> 						// be found, this throws SQLException.
>-						if (requestPassword)
>-							getConnection(user, password).close();
>-						else
>-							getConnection().close();
>-
>+						if (requestPassword) {
>+							   toClose = getConnection(user, password);
>+                               if(toClose != null)
>+                                   toClose.close();
>+                        }
>+						else {
>+							toClose = getConnection();
>+                            if(toClose != null)
>+                                toClose.close();
>+                        }
> 						// now try to find it again
> 						database = (Database)
> 							Monitor.findService(Property.DATABASE_MODULE, dbName); 
> 					}
> 
>-					if (database != null)
>+					if (database != null)  {
> 						ra = (ResourceAdapter) database.getResourceAdapter();
>+                    }
> 				}
> 
> 				if (ra == null)
>@@ -178,9 +187,8 @@
> 
> 
> 				// If database is already up, we need to set up driver
>-				// seperately. 
>+				// seperately.
> 				findDriver();
>-
> 				if (driver == null)
> 					throw new SQLException(MessageService.getTextMessage(MessageId.CORE_DRIVER_NOT_AVAILABLE),
> 										   "08006",
>  
>


Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by Shreyas Kaushik <Sh...@Sun.COM>.
That would be just great.Thanks!!!

Shreyas

Daniel John Debrunner wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Shreyas Kaushik wrote:
>
>  
>
>>Here is the latest version of the patch with the aprropriate messages.
>>
>>thanks
>>Shreyas
>>    
>>
>
>
>Great, can I commit this with a couple of minor changes?
>
>1) In EmbeddedDataSource rename the local variable you added from
>'toClose' to 'conn'. This is because in most cases this Connection
>object is not going to be closed, so the name is misleading.
>
>
>2) Discard all the changes for EmbeddedXADataSource. Now that
>getConnection() correctly does not return null, it is no longer
>necessary to check for its return being null. Once those changes are
>removed from this file, all the other changes are cosmetic.
>
>Thanks,
>Dan.
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.5 (MingW32)
>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
>iD8DBQFB78LyIv0S4qsbfuQRAl+lAJ0ao6ngh4Zk869Twc4C9yIPSV/u0wCeLalw
>2fBzJFAsv7Ebl0n0rQKyDX4=
>=R0RB
>-----END PGP SIGNATURE-----
>
>  
>

Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shreyas Kaushik wrote:

> Here is the latest version of the patch with the aprropriate messages.
>
> thanks
> Shreyas


Great, can I commit this with a couple of minor changes?

1) In EmbeddedDataSource rename the local variable you added from
'toClose' to 'conn'. This is because in most cases this Connection
object is not going to be closed, so the name is misleading.


2) Discard all the changes for EmbeddedXADataSource. Now that
getConnection() correctly does not return null, it is no longer
necessary to check for its return being null. Once those changes are
removed from this file, all the other changes are cosmetic.

Thanks,
Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFB78LyIv0S4qsbfuQRAl+lAJ0ao6ngh4Zk869Twc4C9yIPSV/u0wCeLalw
2fBzJFAsv7Ebl0n0rQKyDX4=
=R0RB
-----END PGP SIGNATURE-----


Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by Shreyas Kaushik <Sh...@Sun.COM>.
Here is the latest version of the patch with the aprropriate messages.

thanks
Shreyas

Daniel John Debrunner wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>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
>>functionality...
>>    
>>
>
>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
>org.apache.derby.jdbc.EmbeddedDataSource();
>
>ds.setDatabaseName("jdbc:derby:fred");
>
>Connection conn = ds.getConnection();
>
>// NPE here because conn is null
>conn.close();
>
>
>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'.
>
>Thanks,
>Dan.
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.5 (MingW32)
>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
>iD8DBQFB7rJnIv0S4qsbfuQRApTGAKDj+MxB4kOY/GNFCMs/9R5Js3zK2wCgqYSm
>DrAWFRgPOfwMHin0vUwGi70=
>=zL6e
>-----END PGP SIGNATURE-----
>
>  
>

Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by myrna <my...@Golux.Com>.
Daniel John Debrunner wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>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
>>functionality...
>>    
>>
>
>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
>org.apache.derby.jdbc.EmbeddedDataSource();
>
>ds.setDatabaseName("jdbc:derby:fred");
>
>Connection conn = ds.getConnection();
>
>// NPE here because conn is null
>conn.close();
>
>
>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'.
>
>Thanks,
>Dan.
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.2.5 (MingW32)
>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
>iD8DBQFB7rJnIv0S4qsbfuQRApTGAKDj+MxB4kOY/GNFCMs/9R5Js3zK2wCgqYSm
>DrAWFRgPOfwMHin0vUwGi70=
>=zL6e
>-----END PGP SIGNATURE-----
>
>  
>
I see your point. My initial test case was overly simplistic - never 
actually did anything with the connection.

Myrna

Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by Daniel John Debrunner <dj...@debrunners.com>.
-----BEGIN PGP SIGNED MESSAGE-----
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
> functionality...

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
org.apache.derby.jdbc.EmbeddedDataSource();

ds.setDatabaseName("jdbc:derby:fred");

Connection conn = ds.getConnection();

// NPE here because conn is null
conn.close();


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'.

Thanks,
Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFB7rJnIv0S4qsbfuQRApTGAKDj+MxB4kOY/GNFCMs/9R5Js3zK2wCgqYSm
DrAWFRgPOfwMHin0vUwGi70=
=zL6e
-----END PGP SIGNATURE-----


Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by Shreyas Kaushik <Sh...@Sun.COM>.
As Dan pointed out in one of his comments the EmbeddedDataSource 
implements the *javax.sql.DataSource* interface. The getConnection() 
method according
to that conttract cannot retun null.

It should return a connection handle or throw a SQLException if a 
database access error occurs. I guess the current approach is the right 
one to take.

thanks,
Shreyas

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 
> functionality...
>
> Myrna
>
> Shreyas Kaushik wrote:
>
>> Any comments/updates on this?
>>
>> thanks
>> Shreyas
>>
>> Shreyas Kaushik (JIRA) wrote:
>>
>>>     [ 
>>> http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57577 
>>> ]
>>>     Shreyas Kaushik commented on DERBY-95:
>>> --------------------------------------
>>>
>>> Attaching the latest patch as per Dan's comments so that the 
>>> getConnection() method in EmbeddedDataSource does not return null. 
>>> It will throw a SQLException if the driver is not able to connect to 
>>> the database.
>>>
>>> Also attaching the latest diff.
>>>
>>>  
>>>
>>>> NPE when passing in url instead of database name to 
>>>> EmbeddedXADataSource
>>>> ------------------------------------------------------------------------ 
>>>>
>>>>
>>>>         Key: DERBY-95
>>>>         URL: http://issues.apache.org/jira/browse/DERBY-95
>>>>     Project: Derby
>>>>        Type: Bug
>>>>  Components: JDBC
>>>>    Reporter: Myrna van Lunteren
>>>>    Priority: Minor
>>>>     Fix For: 10.0.2.1
>>>> Attachments: Derby-95.diff, Derby-95_latest.diff
>>>>
>>>> When passing in a url (e.g. jdbc:derby:mydb) instead of just the 
>>>> database name (e.g. mydb) the XADataSource gives a 
>>>> NullPointerException.
>>>> It should either handle this a little more gracefully & give an 
>>>> error, or accept the url (like EmbeddedDataSource does).
>>>>   
>>>
>>>
>>>
>>>  
>>>
>>
>

Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by myrna <my...@Golux.Com>.
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 
functionality...

Myrna

Shreyas Kaushik wrote:

> Any comments/updates on this?
>
> thanks
> Shreyas
>
> Shreyas Kaushik (JIRA) wrote:
>
>>     [ 
>> http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57577 
>> ]
>>     Shreyas Kaushik commented on DERBY-95:
>> --------------------------------------
>>
>> Attaching the latest patch as per Dan's comments so that the 
>> getConnection() method in EmbeddedDataSource does not return null. It 
>> will throw a SQLException if the driver is not able to connect to the 
>> database.
>>
>> Also attaching the latest diff.
>>
>>  
>>
>>> NPE when passing in url instead of database name to 
>>> EmbeddedXADataSource
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>>         Key: DERBY-95
>>>         URL: http://issues.apache.org/jira/browse/DERBY-95
>>>     Project: Derby
>>>        Type: Bug
>>>  Components: JDBC
>>>    Reporter: Myrna van Lunteren
>>>    Priority: Minor
>>>     Fix For: 10.0.2.1
>>> Attachments: Derby-95.diff, Derby-95_latest.diff
>>>
>>> When passing in a url (e.g. jdbc:derby:mydb) instead of just the 
>>> database name (e.g. mydb) the XADataSource gives a 
>>> NullPointerException.
>>> It should either handle this a little more gracefully & give an 
>>> error, or accept the url (like EmbeddedDataSource does).
>>>   
>>
>>
>>  
>>
>


Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by Shreyas Kaushik <Sh...@Sun.COM>.
Any comments/updates on this?

thanks
Shreyas

Shreyas Kaushik (JIRA) wrote:

>     [ http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57577 ]
>     
>Shreyas Kaushik commented on DERBY-95:
>--------------------------------------
>
>Attaching the latest patch as per Dan's comments so that the getConnection() method in EmbeddedDataSource does not return null. It will throw a SQLException if the driver is not able to connect to the database.
>
>Also attaching the latest diff.
>
>  
>
>>NPE when passing in url instead of database name to EmbeddedXADataSource
>>------------------------------------------------------------------------
>>
>>         Key: DERBY-95
>>         URL: http://issues.apache.org/jira/browse/DERBY-95
>>     Project: Derby
>>        Type: Bug
>>  Components: JDBC
>>    Reporter: Myrna van Lunteren
>>    Priority: Minor
>>     Fix For: 10.0.2.1
>> Attachments: Derby-95.diff, Derby-95_latest.diff
>>
>>When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
>>It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).
>>    
>>
>
>  
>

[jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57577 ]
     
Shreyas Kaushik commented on DERBY-95:
--------------------------------------

Attaching the latest patch as per Dan's comments so that the getConnection() method in EmbeddedDataSource does not return null. It will throw a SQLException if the driver is not able to connect to the database.

Also attaching the latest diff.

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1
>  Attachments: Derby-95.diff, Derby-95_latest.diff
>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Myrna van Lunteren (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=all ]
     
Myrna van Lunteren closed DERBY-95:
-----------------------------------


> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug

>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Assignee: Shreyas Kaushik
>     Priority: Minor
>      Fix For: 10.0.2.1
>  Attachments: Derby-95.diff, Derby-95_latest.diff
>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57308 ]
     
Daniel John Debrunner commented on DERBY-95:
--------------------------------------------

EmbeddedXADataSource.getConnection() should not be returning null, as it implements the XADataSource.getConnection() contract.

As Shreyas says it is returning null because the formed JDBC URL is not handled by Derby.

My guess is that EmbeddedDriver.getConnection() method is (correctly) returning null as it does not handle that URL. Thus somehow that null is making EmbeddedXADataSource.getConnection() return null, which is strange as the two methods have different return types. So I think the DataSource implementations probably don't handle a null from EmbeddedDriver.getConnection() correctly.

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1

>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57940 ]
     
Daniel John Debrunner commented on DERBY-95:
--------------------------------------------

Fixed with svn revision 126038 from Shreyas Kaushik <Sh...@Sun.COM>

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1
>  Attachments: Derby-95.diff, Derby-95_latest.diff
>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by Shreyas Kaushik <Sh...@Sun.COM>.
Can someone please add comments here for this issue. If people are ok
with the way it is currently behaving we can go ahead with the proposed
solution that I have suggested in one of my previous comments.

thanks
Shreyas

Shreyas Kaushik (JIRA) wrote:
>      [ http://nagoya.apache.org/jira/browse/DERBY-95?page=comments#action_57065 ]
>      
> Shreyas Kaushik commented on DERBY-95:
> --------------------------------------
> 
> The getConnection() method returns null because the url is of the format as shown below:
> 
> "jdbc:derby:jdbc:derby:databaseName=testdb".
> 
> As said in my previous comment it treats the entire string passed to the setDatabaseName as a valid database and tries to establish a connection to that. The url is built in the update() method in the EmbeddedXADataSource.java where it just appends the databaseName that is set previously to the Protocol string, hence the error.
> 
>    So we need to figure out what needs to be done here, specify/document that a valid databaseName should be passed to the setDatabaseName() if it is not passed a SQLException is thrown saying no DB exists. Alternatively, try and verify/ validate whatever is passed as argument( i feel the first approach is the way to go ) and take action accordingly.
> 
>   In the second case the extra effort of validation is required.
> 
> 
>>NPE when passing in url instead of database name to EmbeddedXADataSource
>>------------------------------------------------------------------------
>>
>>         Key: DERBY-95
>>         URL: http://nagoya.apache.org/jira/browse/DERBY-95
>>     Project: Derby
>>        Type: Bug
>>  Components: JDBC
>>    Reporter: Myrna van Lunteren
>>    Priority: Minor
>>     Fix For: 10.0.2.1
> 
> 
>>When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
>>It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).
> 
> 


[jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ http://nagoya.apache.org/jira/browse/DERBY-95?page=comments#action_57065 ]
     
Shreyas Kaushik commented on DERBY-95:
--------------------------------------

The getConnection() method returns null because the url is of the format as shown below:

"jdbc:derby:jdbc:derby:databaseName=testdb".

As said in my previous comment it treats the entire string passed to the setDatabaseName as a valid database and tries to establish a connection to that. The url is built in the update() method in the EmbeddedXADataSource.java where it just appends the databaseName that is set previously to the Protocol string, hence the error.

   So we need to figure out what needs to be done here, specify/document that a valid databaseName should be passed to the setDatabaseName() if it is not passed a SQLException is thrown saying no DB exists. Alternatively, try and verify/ validate whatever is passed as argument( i feel the first approach is the way to go ) and take action accordingly.

  In the second case the extra effort of validation is required.

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://nagoya.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1

>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=comments#action_57472 ]
     
Daniel John Debrunner commented on DERBY-95:
--------------------------------------------

The patch does not address the underlying bug that getConnection() is returning null when it can not according to its contract (from DataSource). I assume if such a database name was set in EmbeddedDataSource, then its getConnection() method would return null (as it's the method that EmbeddedXADataSource inherits). Thus I think the references to EmbeddedXADataSource are misleading, the bug is actually in EmbeddedDataSource.

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1
>  Attachments: Derby-95.diff
>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-95) NPE when passing in url instead of database name to EmbeddedXADataSource

Posted by "Shreyas Kaushik (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-95?page=history ]

Shreyas Kaushik updated DERBY-95:
---------------------------------

    Attachment: Derby-95_latest.diff

> NPE when passing in url instead of database name to EmbeddedXADataSource
> ------------------------------------------------------------------------
>
>          Key: DERBY-95
>          URL: http://issues.apache.org/jira/browse/DERBY-95
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Reporter: Myrna van Lunteren
>     Priority: Minor
>      Fix For: 10.0.2.1
>  Attachments: Derby-95.diff, Derby-95_latest.diff
>
> When passing in a url (e.g. jdbc:derby:mydb) instead of just the database name (e.g. mydb) the XADataSource gives a NullPointerException.
> It should either handle this a little more gracefully & give an error, or accept the url (like EmbeddedDataSource does).

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira