[ 
https://issues.apache.org/jira/browse/DBCP-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16583059#comment-16583059
 ] 

Gary Gregory commented on DBCP-519:
-----------------------------------

Can't edit comments here? Annoying!
{quote}
There is no sync control in the builders so returned data may be inconsistent 
(may be a practical non-issue, but might be good to doc)
{quote}
I think the simplest would be to mark the {{toString()}} methods as 
synchronized to get a sane snapshot of an object. WDYT?

{quote}
You should check to make sure you have not exposed more info on executing SQL 
than is already available via JMX. That should be discussed if it is the case.
{quote}
I have two goals:
- "see" objects in the debugging without drilling down
- toString() objects for debug logging
So JMX is orthogonal to me

{quote}
The setup is nice and clean but I wonder if ongoing maintenance is going to be 
easy (just really asking to look at the impl and think about what maintaining 
it is going to be like as fields are added, etc)
{quote}
As soon as you write any kind of toString(), you have extra maintenance. Simple 
when you remove a field, easy to forget to update the toString() when you add 
one. The same can be said of hashCode() and equals() methods.

> Add some toString() methods for debugging (never printing passwords)
> --------------------------------------------------------------------
>
>                 Key: DBCP-519
>                 URL: https://issues.apache.org/jira/browse/DBCP-519
>             Project: Commons DBCP
>          Issue Type: Improvement
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>            Priority: Major
>             Fix For: 2.6.0
>
>
> Add some toString() methods for debugging never printing passwords:
>  * org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS
>  * org.apache.commons.dbcp2.cpdsadapter.PooledConnectionImpl
>  * org.apache.commons.dbcp2.datasources.CPDSConnectionFactory
>  * org.apache.commons.dbcp2.datasources.InstanceKeyDataSource
>  * org.apache.commons.dbcp2.datasources.PerUserPoolDataSource
>  * org.apache.commons.dbcp2.datasources.SharedPoolDataSource
>  * org.apache.commons.dbcp2.datasources.UserPassKey (updated not to print 
> passwords even though it was a char[] reference.)
> I went YAGNI here and only added what I needed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to