commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <...@intermeta.de>
Subject [DBCP] InstanceKeyDataSource
Date Sun, 12 Oct 2003 13:49:08 GMT
Hello DBCP-Developers,

can we please get a "public" in front of the 

--- cut ---
abstract class InstanceKeyDataSource
        implements DataSource, Referenceable, Serializable {
--- cut ---

class definition.

Reason for this: 

Torque (db.apache.org/torque) uses both commons-dbcp and also
commons-beanutils to set the properties of a data source. It does so
by calling PropertyUtils.setSimpleProperty() on a SharedPoolDataSource
object which in turn extends InstanceKeyDataSource.

Unfortunately, for resolving the accessibility of the property,
BeanUtils use MethodUtils from the BeanUtils package which notices
that the class which defines e.g. setValidationQuery() and
setTestOnBorrow() is not public and denies the property setting. So
one cannot set these properties from the Torque init. You get

ERROR - Property: testOnBorrow value: true is not supported by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
ERROR - Property: validationQuery value: SELECT 1 is not supported by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource

which, of course, is wrong.
 
It's now argueable whether this is a bug in commons-beanutils (which
should see that the class itself (SharedPoolDataSource) which extends
a non-public class, making the properties visible, even if the
declaring class (InstanceKeyDataSource) is not public, however be it
as it is, something must change to make Torque work better with
DBCP. And to me it's easier to simply add a "public" to the class than
redesigning the beanutils method validator....

So, please, add a public modifier to InstanceKeyDataSource. Thanks.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

"Dominate!! Dominate!! Eat your young and aggregate! I have grotty silicon!" 
      -- AOL CD when played backwards  (User Friendly - 200-10-15)

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


Mime
View raw message