会话与会话工厂之间的区别-休眠? [英] Differences between session vs session factory - Hibernate?

查看:106
本文介绍了会话与会话工厂之间的区别-休眠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除以下内容外,我们还有其他区别吗?另外,请验证以下内容是否正确

Do we have any other differences other than the below? Also please validate whether the below are correct

    每个应用程序
  1. SessionFactory对象是一个,每个客户端Session对象是一个.
  2. SessionFactory用于创建和管理Sessions. Session为以下对象提供CRUD接口: 映射的类,还可以访问更通用的Criteria API.
  3. SessionFactory是线程安全的,而Session不是线程安全的
  1. SessionFactory objects are one per application and Session objects are one per client.
  2. SessionFactory is to create and manage Sessions. Session is to provide a CRUD interface for mapped classes, and also access to the more versatile Criteria API.
  3. SessionFactory is thread safe where as Session 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆