Hi.
Performance issues leads me to mix jdo with some plain jdbc code.
For that reason, i wish to use the spring orm implementation for castor.
I wrote a method :
public DataSource getDbDs(String dbId) {
CastorTransactionManager ctm = new
CastorTransactionManager(_jdoMap.get(dbId));
return ctm.getDataSource();
}
_jdoMap being a map of JDOManagers successfully initialized.
Each JDOManager points to a database conf that maps a data-source such :
<data-source class-name="org.apache.commons.dbcp.BasicDataSource">
<param name="driver-class-name"
value="com.informix.jdbc.IfxDriver" />
<param name="username" value="informix" />
<param name="password" value="informix" />
<param name="url" value="jdbc:informix-sqli://url" />
<param name="maxActive" value="10" />
<param name="initialSize" value="3" />
<param name="removeAbandoned" value="true" />
</data-source>
But the "getDbDs" method returns null anyway.
Any issue ?
NB :
The javadoc for "CastorTransactionManager" specifies this :
"With a CastorDialect specified, this implementation also supports
direct DataSource access within a transaction (i.e. plain JDBC code
working with the same DataSource). This allows for mixing services that
access Castor JDO (including transactional caching) and services that
use plain JDBC (without being aware of Castor JDO)! Application code
needs to stick to the same simple Connection lookup pattern as with
DataSourceTransactionManager (i.e. |DataSourceUtils.getConnection|)."
--
Sébastien PERES-LABOURDETTE