会话与会话工厂之间的区别-休眠? [英] Differences between session vs session factory - Hibernate?
本文介绍了会话与会话工厂之间的区别-休眠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
除以下内容外,我们还有其他区别吗?另外,请验证以下内容是否正确
Do we have any other differences other than the below? Also please validate whether the below are correct
-
每个应用程序
-
SessionFactory
对象是一个,每个客户端Session
对象是一个. -
SessionFactory
用于创建和管理Sessions
.Session
为以下对象提供CRUD接口: 映射的类,还可以访问更通用的Criteria API
. -
SessionFactory
是线程安全的,而Session
不是线程安全的
SessionFactory
objects are one per application andSession
objects are one per client.SessionFactory
is to create and manageSessions
.Session
is to provide a CRUD interface for mapped classes, and also access to the more versatileCriteria API
.SessionFactory
is thread safe where asSession
is not thread safe
推荐答案
首先,询问这些接口之间的区别没有任何意义.好像在问汽车制造厂和汽车之间的区别.制造工厂是生产汽车的地方.同样,SessionFactory
是将创建Session
对象的实例.
First of all, asking the difference between these interfaces doesn't make any sense. It seems like asking the difference between car manufacturing plant and car. A manufacturing plant is a place where the cars will be produced. Similarly, SessionFactory
is an instance which will create Session
objects.
这篇关于会话与会话工厂之间的区别-休眠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文