日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

Hibernate transaction

系統(tǒng) 2063 0

?

(captured from a very good?Hibernate Book,?copyright belongs to the author)

?

First type lost

First transaction’s rollback overwrite second transaction’s update on same record

?

Second type lost

First transaction’s commit overwrite second transaction’s update on the same record

?

Dirty Read

Read uncommitted data

?

Phantom Read

Second read get extra record

?

Non-repeatable read

Two read return’s different result.

?(All above issues is due to someone did something in the middle of a transaction, I hate being interupted)

?

If one session has exception, need close it, not resue again.

??

Database Lock types

share

exclusive

update

?

Database lock applied ranges

1. database

2. table

3. area

5. page

6. record

...

?

?Transaction optimize

1. short transaction

2. reduce the transaction isolation level if consistency is not strict

?

Database Lock

1. Optimistic lock

  • Version field goes after the definition of ID
  • timestamp can also do the job
  • version is better than timestamp, because system only check to second, actually transaction might happen within 1 second.

2. Pessmistic lock

  • application lock through database exclusive lock
  • database add extra column as locker

?

Hibernate transaction


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 梧州市| 绥阳县| 寿阳县| 白城市| 错那县| 甘南县| 花垣县| 大关县| 鹤峰县| 桂东县| 汨罗市| 建阳市| 固镇县| 河西区| 观塘区| 兰坪| 海原县| 唐海县| 乌鲁木齐市| 修水县| 北辰区| 吴川市| 收藏| 灵山县| 古蔺县| 木兰县| 纳雍县| 霍州市| 南昌市| 红河县| 泾源县| 天镇县| 孟州市| 四川省| 大姚县| 兴宁市| 金堂县| 汝州市| 肥城市| 湄潭县| 新建县|