Created
February 23, 2011 22:46
-
-
Save wfaler/841361 to your computer and use it in GitHub Desktop.
squerylpooling.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// SECTION TO SETUP CONNECTION POOLING & DB FOR SQUERYL | |
// Setup connection pooling for Squeryl with C3P0 | |
val cpds = new ComboPooledDataSource | |
cpds.setDriverClass("org.h2.Driver") | |
cpds.setJdbcUrl("jdbc:h2:mem:test") | |
cpds.setUser("sa") | |
cpds.setPassword("") | |
cpds.setMinPoolSize(5) | |
cpds.setAcquireIncrement(1) | |
cpds.setMaxPoolSize(10) | |
SessionFactory.concreteFactory = Some(() => connection) | |
def connection = { | |
Session.create(cpds.getConnection, new H2Adapter) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment