我是一个冬眠的新人,
从下面的链接,
Hibernate Session Connection Relationship I understood that one hibernate session object will hold one connection object.
所以,我的怀疑是,如果我把我的连接池大小配置为服务器上的 10 个大小。 在应用程序中,只有 10 个人可以同时工作吗?
如果我错了 请纠正我
我是一个冬眠的新人,
从下面的链接,
Hibernate Session Connection Relationship I understood that one hibernate session object will hold one connection object.
所以,我的怀疑是,如果我把我的连接池大小配置为服务器上的 10 个大小。 在应用程序中,只有 10 个人可以同时工作吗?
如果我错了 请纠正我
部分是的。 这意味着只有10个 SQL 查询可以同时执行。 如果11个客户在同一时间访问同一页,而且大部分时间花在一些长期的 SQL 查询中,那么第11个客户很可能要等其余10个客户中的一个完成。
但这并不意味着您的应用程序仅限于10个会话/客户 。 例如, 在网络应用程序中, 用户通常打开一个页面, 浏览一段时间, 点击链接等 。 如果您的用户花费9 秒阅读页面, 1秒等待下一页, 那么只有10%的时间花在服务器上 - 因此您可以在用户中处理 100 个登录 。
此外,处理请求不仅涉及 SQL 查询。 发送数据、 解析、 转换... ---- 这需要时间 。
因此,基本上,你仅限于10个同时的 SQL 查询,但这意味着10x 或可能100x 以上的用户可以使用您的应用程序。
对,但这并不限制用户数量为10个,因为在一个典型的应用程序中,用户点击链接,导致连接使用几毫秒(加载页面的时间),然后对页面看几秒或几分钟。
所以,如果空闲时间与忙碌时间的比率平均为100, 你可以期望有1000个用户共享你的游泳池中的10个连接, 一切都应该很好( 当然这是一个近似值, 不考虑连续、 长期的任务等等, 但是你明白这个想法 ) 。
总起来说:用户仅在交易期间使用连接,交易时间应该非常短(尽可能短 ) 。 这使得许多同时使用的用户成为可能。
Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...
Check this, List<String> list = new ArrayList<String>(); for (int i = 0; i < 10000; i++) { String value = (""+UUID.randomUUID().getLeastSignificantBits()).substring(3, ...
I am in the middle of solving a problem where I think it s best suited for a decorator and a state pattern. The high level setting is something like a sandwich maker and dispenser, where I have a set ...
I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I ...
I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...
If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...
I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....
I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...