简体   繁体   English

电梯连接池?

[英]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. 我刚刚进入电梯框架,我很好奇默认的非jndi路径如何与连接相关。 All of the docs and examples I've seen recommend using a pattern that directly calls DriverManager.getConnection to obtain DB connections. 我见过的所有文档和示例都建议使用直接调用DriverManager.getConnection来获取数据库连接的模式。 Having come from several years of java/spring developement, this of course gives me The Willies. 来自几年的java / spring开发,这当然给了我The Willies。

My question is thus - should I plug in something like c3p0 or dbcp in my DBVendor implementation? 我的问题是 - 我应该在我的DBVendor实现中插入类似c3p0或dbcp的东西吗? Or does the lift DB object do it's own connection pooling? 或者电梯DB对象是否有自己的连接池? 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. 从外观上看 ,Lift的ProtoDBVendorStandardDBVendor扩展)将连接保存在列表中。 If you use this implementation you're getting the connection pooling provided by Lift, therefore. 如果您使用此实现,则会获得Lift提供的连接池。 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. 如果您对此不满意,可以提供ConnectionManager特征的实现,并使用首选连接池提供newConnectionreleaseConnection方法的实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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