博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
java for update 无效_java – 事务性保存而不调用update方法
阅读量:5323 次
发布时间:2019-06-14

本文共 1521 字,大约阅读时间需要 5 分钟。

Transient – an object is transient if it has just been instantiated using the new operator, and it is not associated with a Hibernate Session. It has no persistent representation in the database and no identifier value has been assigned. Transient instances will be destroyed by the garbage collector if the application does not hold a reference anymore. Use the Hibernate Session to make an object persistent (and let Hibernate take care of the SQL statements that need to be executed for this transition).

Persistent – a persistent instance has a representation in the database and an identifier value. It might just have been saved or loaded, however, it is by definition in the scope of a Session. Hibernate will detect any changes made to an object in persistent state and synchronize the state with the database when the unit of work completes. Developers do not execute manual UPDATE statements, or DELETE statements when an object should be made transient.

Detached – a detached instance is an object that has been persistent, but its Session has been closed. The reference to the object is still valid, of course, and the detached instance might even be modified in this state. A detached instance can be reattached to a new Session at a later point in time, making it (and all the modifications) persistent again. This feature enables a programming model for long running units of work that require user think-time. We call them application transactions, i.e., a unit of work from the point of view of the user.

转载地址:http://sphhv.baihongyu.com/

你可能感兴趣的文章
SaltStack入门篇(四)之深入理解SaltStack远程执行
查看>>
JVM家族史考【转】
查看>>
WPF-编程问题和解决
查看>>
Android Studio 查看手机CPU信息
查看>>
00-自测5. Shuffling Machine
查看>>
牛客练习赛25 C 再编号
查看>>
『 学习笔记 』网络最大流
查看>>
http请求415错误Unsupported Media Type
查看>>
【转】JS函数的定义与调用方法
查看>>
DOM,windows 对象
查看>>
BEGIN_MESSAGE_MAP
查看>>
鸡尾酒排序算法
查看>>
VC++动态链接库 .
查看>>
RE:从零开始的AGC被虐(到)生活(不能自理)
查看>>
(转载)WPF中的动画——(一)基本概念
查看>>
InstallShield打包,以及集成TFS、JenKins
查看>>
[转载] Rss 与 Feed 的概念区别
查看>>
【转】数据库垂直、水平拆分六大原则
查看>>
吉首大学2019年程序设计竞赛(重现赛)D - 数列求和(嘤雄难度)
查看>>
云计算和大数据时代网络技术揭秘(三)安全的网络准入
查看>>