commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Fabulich <...@fabulich.com>
Subject Re: [dbutils] QueryRunner.fillStatement and the null problem (long)
Date Mon, 09 Feb 2009 22:01:14 GMT
Liam Coughlin wrote:

> b) Yes it will have a thread safety issue -- you'll need to synchronize on
> something when setting the pmdKnownBroken variable.

When setting?  Or when reading?  Remember, once pmdKnownBroken is true, it 
will never again be false, so there's no risk that one thread will try to 
set it to true and another thread will try to set it to false.

IMO the biggest risks here are:

1) Running getParameterType too many times (ideally we should only ever 
run it once on Oracle, but that may be too much to ask)

2) We overcompensate and create an unecessary synchronization bottleneck

What if I just make pmdKnownBroken "volatile"?

-Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message