Friday 7 December 2007

Unable to proxy datasources

In the DataSourceObjectBuilder , the code, given an XADataSource interface, look at the implementation class and call methods that are not part of the interface, using reflection.

This means its not possible to pass in a dynamic proxy or indeed any actual interface...

take a look here:

1 comment:

Unknown said...

What problems are you facing because of this code ?

The purpose of the code is to set "vendor" specific properties/feature values.

eg: MySQLDataSource (instance of javax.sql.DataSource) also provides 100+ properties as custom datasource implementation (http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html)

to set these values in glassfish, one can create connection-pool and set values to these properties through admin-gui/cli. These values need to be set for the instantiated datasource (The code in question does this). Hope this helps.

Actual DataSourceObjectBuilder is at
http://fisheye5.cenqua.com/browse/glassfish/jdbcra/src/com/sun/gjc/common/DataSourceObjectBuilder.java