首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Session 界别

2012-09-17 
Session 区分1.?????? What’s the difference between SessionFactory.getCurrentSession() and SessionFa

Session 区分

1.?????? What’s the difference between SessionFactory.getCurrentSession() and SessionFactory.opeSession();

If get current session is null, session factory will create a new session replace of current session.

Current session will be close automatically after session get transaction commit.

Open session is always a new session was created.

2.?????? Hibernate transation implements in JDBC

JDBC?????????????????????????????????????????????????????????????????????

Hibernate

Connector.setAutoCommit(false)

session.beginTransaction();

Connector.commit()

session.getTransaction().commit()

Connector.setAutoCommit(true)

???????????????????????????????????????????????

热点排行