Hibernate and transactions and table locking

后端 未结 2 1296
情书的邮戳
情书的邮戳 2021-02-13 03:45

If I have code that looks like the following:

beginTransaction();
// lots of stuff happens, can take anywhere from a minute to several minutes.
// it will read f         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-13 04:09

    The best thing is to keep transactions short. The locking semantics depends on the transaction isolation levels though.

    Open Session In View is the pattern your are looking for when you are talking about lazy-fetching/relationships.

提交回复
热议问题