English 中文(简体)
是否开始在Hibernate进行交易,以分配新的亚洲开发银行联系?
原标题:Does beginTransaction in Hibernate allocate a new DB connection?

是否在Hibernate开始新的交易,是否实际上将某种联系分配给了亚洲开发银行?

I m涉及b/c我们的服务器开始对收到的每一项请求进行新的交易,即使这一请求与亚洲开发银行没有互动。 我们再把非行连接视为主要的瓶颈,因此我很想知道,我是否应当花时间缩小我的交易范围。

在任何地方进行搜捕,没有发现好的答案。 非常简单的法典在这里是:

    SessionFactory sessionFactory = (SessionFactory) Context.getContext().getBean("sessionFactory");
    sessionFactory.getCurrentSession().beginTransaction();
    sessionFactory.getCurrentSession().setFlushMode(FlushMode.AUTO);

thanks very much! a

最佳回答

(每篇Pascal Thivent评论更新)

每一条<代码>>><>> /代码”均建立数据库链接,条件是有必要,例如,交易开始。 仅仅因为届会的召开,这一联系并不开放。

为克服这种情况,您可使用connecetiongroup,以便重新利用链接。 或者,你可以确保(正如你所看到的那样)不自动开始交易。

(. This Discussiones读作的交易。 检查。

问题回答




相关问题
Spring Properties File

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 ...

Logging a global ID in multiple components

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 ...

Java Library Size

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 ...

How to get the Array Class for a given Class in Java?

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....

SQLite , Derby vs file system

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 ...

热门标签