[ 
http://issues.apache.org/jira/browse/DERBY-530?page=comments#action_12329429 ] 

Kathey Marsden commented on DERBY-530:
--------------------------------------

Checked into the trunk.

Date: Thu Sep 15 05:49:14 2005
New Revision: 289227

URL: http://svn.apache.org/viewcvs?rev=289227&view=rev
Log:
DERBY-530 
ClientDriver ignores Properties object in connect(String url, Properties 
connectionProperties) method

In 1  derbyAll run I saw a failure in DerbyNetAutoStart.  It was an exception 
from network server  closing   the connections after Derby was intentionally 
shut down,  similar to DERBY-273.   I was not able to reproduce the failure 
after many dozens of runs of the test and repeating derbyAll.  Looking at the 
test   I see that Derby is intentionally shut  down and so the exception is not 
unexpected but the shutdown is not passed through properties, so I am assuming 
that this was a rare intermittent diff and not caused by this change.  

Probably still to be resolved is what  Network Server should do with exceptions 
that occur before Derby is started or after Derby is shut down.  Right now it 
prints them to the console or System.out if the console is not specified. It 
seems like it could at least print them to derby.log if only the database and 
not the engine was shut down.


> ClientDriver ignores Properties object in connect(String url, Properties 
> connectionProperties) method
> -----------------------------------------------------------------------------------------------------
>
>          Key: DERBY-530
>          URL: http://issues.apache.org/jira/browse/DERBY-530
>      Project: Derby
>         Type: Bug
>   Components: Network Client
>     Versions: 10.1.1.0
>  Environment: windows XP, JRE 1.5.0_04
>     Reporter: Piet Blok
>     Assignee: Kathey Marsden
>  Attachments: DERBY530.diff
>
> In contrast to EmbeddedDriver, a connection attribute create=true is not 
> recognized when presented as a property in a Properties object.
>  As a workaround I append the attributes from the Properties object to the 
> url string before invoking the connect() method: then a new database is 
> created and a connection is established.
> Next code fragment illustrates the bug and the workaround:
>     private static final ClientDriver clientDriver = new ClientDriver();
>     private Connection getClientConnection(String database,
>             Properties connectionProperties) throws SQLException {
>         try {
>             System.out.println("Try to connect with properties");
>             String connectionURL = "jdbc:derby://127.0.0.1:1527/" + database;
>             System.out.println("connectionURL: " + connectionURL);
>             Connection rv = clientDriver.connect(connectionURL,
>                     connectionProperties);
>             System.out.println("Connection: " + rv);
>             return rv;
>         } catch (SQLException e) {
>             System.out.println("Try to connect with URL attributes");
>             StringBuffer sb = new StringBuffer();
>             for (Enumeration enu = connectionProperties.propertyNames(); enu
>                     .hasMoreElements();) {
>                 String key = (String) enu.nextElement();
>                 sb.append(';');
>                 sb.append(key);
>                 sb.append('=');
>                 sb.append(connectionProperties.getProperty(key, ""));
>             }
>             String connectionURL = "jdbc:derby://127.0.0.1:1527/" + database
>                     + sb.toString();
>             System.out.println("connectionURL: " + connectionURL);
>             Connection rv = clientDriver.connect(connectionURL,
>                     connectionProperties);
>             System.out.println("Connection: " + rv);
>             System.out
>                     .println("!!!!!!!!!!! seems a bug: Properties argument in 
> ClientDriver.connect(String, Properties) has not been used");
>             return rv;
>         }
>     }

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

Reply via email to