Eduardo M. Cavalcanti
unread,Jun 22, 2011, 12:23:35 PM6/22/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to orbroker
Hi,
Just for the record in case someone goes through this error.
Was using SimpleDataSource, and was getting erros like of the title.
It seemed to be a connection exaustion situation.
I had setup a builder object like :
object OrBroker {
private lazy val dbConfigFile = new
PropertiesFile("database.properties")
private lazy val driver = dbConfigFile.property("driver").get
private lazy val url = dbConfigFile.property("url").get
private lazy val ds = new SimpleDataSource(url, driver)
private lazy val builder = new BrokerBuilder(ds)
def build: Broker = builder.build
}
Then this fixed the situation:
import oracle.jdbc.pool.OracleDataSource
import java.util.Properties
object OrBroker {
private lazy val dbConfigFile = new
PropertiesFile("database.properties")
private lazy val url = dbConfigFile.property("url").get
private lazy val user = dbConfigFile.property("user").get
private lazy val password = dbConfigFile.property("password").get
private lazy val ods = {
val ods = new OracleDataSource();
ods.setURL(url);
ods.setUser(user);
ods.setPassword(password);
// caching parms
ods.setConnectionCachingEnabled(true)
ods.setConnectionCacheName("cache_name_123")
val cacheProps = new Properties()
cacheProps.setProperty("MinLimit", "1")
cacheProps.setProperty("MaxLimit", "4")
cacheProps.setProperty("InitialLimit", "1")
cacheProps.setProperty("ConnectionWaitTimeout", "5")
cacheProps.setProperty("ValidateConnection", "true")
ods.setConnectionCacheProperties(cacheProps)
ods
}
private lazy val builder = new BrokerBuilder(ods)
def build: Broker = builder.build
}
Regards