You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2009/11/21 23:45:20 UTC
Re: svn commit: r882981 - in /commons/proper/dbcp/trunk:
src/java/org/apache/commons/dbcp/ src/test/org/apache/commons/dbcp/ xdocs/
On 21/11/2009, psteitz@apache.org <ps...@apache.org> wrote:
> Author: psteitz
> Date: Sat Nov 21 20:04:53 2009
> New Revision: 882981
>
> URL: http://svn.apache.org/viewvc?rev=882981&view=rev
> Log:
> Made PoolingConnection pool CallableStatements.
> JIRA: DBCP-204
> Reported and patched by Wei Chen.
>
> Added:
> commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableCallableStatement.java (with props)
...
==============================================================================
> --- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableCallableStatement.java (added)
> +++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableCallableStatement.java Sat Nov 21 20:04:53 2009
...
> +public class PoolableCallableStatement extends DelegatingCallableStatement implements CallableStatement {
> +
> + /**
> + * The {@link KeyedObjectPool} from which this CallableStatement was obtained.
> + */
> + protected KeyedObjectPool _pool = null;
> +
> + /**
> + * Key for this statement in the containing {@link KeyedObjectPool}.
> + */
> + protected Object _key = null;
As far as I can tell, both the above fields could be final, which
would help with thread-safety.
Do they need to be protected? Or could they be private?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r882981 - in /commons/proper/dbcp/trunk: src/java/org/apache/commons/dbcp/
src/test/org/apache/commons/dbcp/ xdocs/
Posted by Phil Steitz <ph...@gmail.com>.
sebb wrote:
> On 21/11/2009, psteitz@apache.org <ps...@apache.org> wrote:
>> Author: psteitz
>> Date: Sat Nov 21 20:04:53 2009
>> New Revision: 882981
>>
>> URL: http://svn.apache.org/viewvc?rev=882981&view=rev
>> Log:
>> Made PoolingConnection pool CallableStatements.
>> JIRA: DBCP-204
>> Reported and patched by Wei Chen.
>>
>> Added:
>> commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableCallableStatement.java (with props)
> ...
>
> ==============================================================================
>> --- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableCallableStatement.java (added)
>> +++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableCallableStatement.java Sat Nov 21 20:04:53 2009
> ...
>> +public class PoolableCallableStatement extends DelegatingCallableStatement implements CallableStatement {
>> +
>> + /**
>> + * The {@link KeyedObjectPool} from which this CallableStatement was obtained.
>> + */
>> + protected KeyedObjectPool _pool = null;
>> +
>> + /**
>> + * Key for this statement in the containing {@link KeyedObjectPool}.
>> + */
>> + protected Object _key = null;
>
> As far as I can tell, both the above fields could be final, which
> would help with thread-safety.
>
> Do they need to be protected? Or could they be private?
Good catch. Yes, they both could and should be private and final.
Phil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org