ORA-12519: TNS:no appropriate service handler found

27 views
Skip to first unread message

Eduardo M. Cavalcanti

unread,
Jun 22, 2011, 12:23:35 PM6/22/11
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

Nils Kilden-Pedersen

unread,
Jun 22, 2011, 12:30:15 PM6/22/11
to orbr...@googlegroups.com
Yes, the SimpleDataSource is only really meant for the odd JDBC implementation without a DataSource. Oracle has one and it should be used instead.
Reply all
Reply to author
Forward
0 new messages