ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google

Mail Archive Home | c-jdbc List | May 2005 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [c-jdbc] NullPointerException when creating a new connection

Hi James,

In particular, if an old connection cannot be recycled, Connection.connectToController() calls setParametersOnConnection(properties, ...) around line 435, which in turn attempts to retrieve quite a few values from the Properties object, causing NPEs. So perhaps it's easier to pass an empty Properties set to connectToController, rather than passing null. I've attached a 3-liner patch which does that, and that works for all my test cases.

Thanks for the fix. I have modified the setParametersOnConnection to better handle null or empty properties which should make the code faster.

One more unrelated question -- Is it expected that C-JDBC Connections not be thread-safe, or am I doing something wrong? I couldn't find anything about it in the documentation.

Yes, because it does not make sense if you are using transactions. If you want the connection to be thread safe, just add the synchronized keyword on all methods of the Connection class (even the protected and private ones).

Thanks for the feedback,

<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.