简体   繁体   中英

Lift connection pool?

I'm just getting into the lift framework, and I'm curious as to how the default non-jndi path works with respect to connections. All of the docs and examples I've seen recommend using a pattern that directly calls DriverManager.getConnection to obtain DB connections. Having come from several years of java/spring developement, this of course gives me The Willies.

My question is thus - should I plug in something like c3p0 or dbcp in my DBVendor implementation? Or does the lift DB object do it's own connection pooling? I've done some reading through the lift codebase, and it appears that it might not be actually caching connections.

By the looks of it, Lift's ProtoDBVendor , which the StandardDBVendor extends keeps the connections in a list. If you use this implementation you're getting the connection pooling provided by Lift, therefore. If you're not happy with that, you can provide your implementation of the ConnectionManager trait, and provide implementations of the newConnection and releaseConnection methods using your preferred connection pool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM