多个 Portlet 向 DB 发出请求
我对整个 portlet 很陌生,我的问题来自于我们公司正在将此类开发外包给另一家公司这一事实。他们面临着这个问题,即有太多的请求发送到数据库,并且同一页面上的许多 portlet 都连接到数据库。
我认为可能有更好的方法,例如对所有这些 portlet 建立一个控制器,该控制器将从数据库中获取所有相关 portlet 的数据,然后将它们存储到会话或其他内容中。或者可能有一个 portlet(可能是隐藏的)将进行所有调用并将每个 portlet 从数据库获取的值存储到会话变量中。
他们使用 RAD 和 WEbsphere Portal 服务器。 这可能吗?
谢谢
im new to this whole portlets my question came from the fact that our company is outsourcing this kind of development for another company. and they are facing this issue, which is there are too many requests going to the DB and many portlets on the same page make connection to the DB.
im thinking probably there is a better way , like for example having a controller over all of those portlets that will fetch data from DB for all related portlets, and then store them into session or something . or maybe one portlet (hidden maybe) that will make all the calls and store the values that it get from DB for each portlet into session variables.
they are using RAD, and WEbsphere Portal server.
is that possible?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信这是一个普遍的问题。我能想到的最好的(就可靠性和简单性而言)是缓存数据库访问 - 使用一些标准的 java 缓存机制:EHCache 或 DynaCache - 如果您想坚持使用 Websphere 堆栈。应该很容易实现,如果你使用像 Hibernate 这样的 ORM,那就更容易了。
在会话中存储数据听起来像是某种本土的缓存尝试,并且通常不会有好的结果。您至少会面临并发问题。
I believe it's a common problem. The best (in terms of reliability & simplicity) I could think of is caching the database access - using some standard java caching mechanisms: EHCache or DynaCache - if you want to stick to Websphere stack. Should be easy to implement, extra-easy if you use ORM like Hibernate.
Storing data in session sounds me like some sort of home-grown caching attempt and that usually doesn't end well. You will face concurrency issues at least.