This is the content of my hibernate.properties file:
Code:
hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
hibernate.connection.datasource java:comp/env/jdbc/OracleDatasource
hibernate.connection.provider_class net.sf.hibernate.connection.DatasourceConnectionProvider
hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
hibernate.jdbc.batch_size 0
hibernate.jdbc.use_streams_for_binary true
hibernate.default_schema SEGURIDAD_ADMINISTRACION
hibernate.max_fetch_depth 1
hibernate.cache.use_query_cache true
hibernate.cache.provider_class net.sf.hibernate.cache.HashtableCacheProvider
To create the SessionFactory I'm using this code:
Code:
InputStream streamMAPPING = SessionController.class.getResourceAsStream(MAPPING_WF);
Configuration cfg = new Configuration().addInputStream(streamMAPPING)
.addClass(Tenedor.class)
.addClass(TipoTenedor.class);
Properties hibernateConfig = new Properties();
hibernateConfig.load(SessionController.class.getResourceAsStream(HIBERNATE_CONFIG));
cfg.setProperties(hibernateConfig);
sessions = cfg.buildSessionFactory();
following the hibernate source for the
cfg.buildSessionFactory() and after a few methods I enter in the class
SettingsFactory then in the line 72 over
Connection conn = connections.getConnection(); when I enter there (the class is:
DatasourceConnectionProvider) the method say:
Code:
public Connection getConnection() throws SQLException {
if (user != null || pass != null) {
return ds.getConnection(user, pass);
}
else {
return ds.getConnection();
}
}
well.. we're near the problem... the ds object isn't null, his type is
Code:
com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource
and when trying to return the connection, there is no exceptions and jump directly to
finally clause in the class where I'm creating the SessionFactory.
Please help, I'm stuck a few days ago with this problem!
Thank you very much!!