Hi everybody!
I`ve found a bug in my Eclipse RCP based application. Looks like it is connections leak.
How can I test that?
As well my application is promting for login/password during startup and I`m creating context like this:
Thread.currentThread().setContextClassLoader(
this.
getClass().
getClassLoader());
DefaultConfiguration conf = new DefaultConfiguration();
conf.addClassPath(Messages.getString("LoginModel.CayenneConfigXMLPath"));
Configuration.initializeSharedConfiguration(conf);
Configuration.bootstrapSharedConfiguration(this.getClass());
DataSource dataSource;
try {
String connectUrl = null;
connectUrl = Messages.getString("LoginModel.jdbcConnectParam");
dataSource =
new PoolManager(Messages.getString("LoginModel.driverClass"),
connectUrl,
ResourceLogin.DB_MIN_CONNECTIONS,
ResourceLogin.DB_MAX_CONNECTIONS,
login,
password);
Configuration config = Configuration.getSharedConfiguration();
DataDomain domain = config.getDomain();
DataNode node = domain.getNode(Messages.getString("LoginModel.Node");
node.setDataSource(dataSource);
return Configuration.getSharedConfiguration()
.getDomain()
.createDataContext();
} catch (SQLException e) {
e.printStackTrace();
return null;
}
I think it is too heavy, what would be the best practice way to create context?
-- Яндекс.Почта: объем почтового ящика не ограничен! http://mail.yandex.ru/monitoring/
This archive was generated by hypermail 2.0.0 : Thu Feb 09 2006 - 06:15:48 EST