休眠、事务和表锁定
如果我的代码如下所示:
beginTransaction();
// lots of stuff happens, can take anywhere from a minute to several minutes.
// it will read from several tables via calling getter methods on lazy relationships.
commitTransaction();
在开始和提交之间,正在从锁定中读取的表是否被锁定,随后这是否会导致多用户环境中的问题,当另一个用户调用上述相同代码时,将出现问题?
如果上述问题,我们是否应该始终尝试保持交易简短?为了促进这一点,而不是在懒惰关系上调用getter方法,这是否意味着最好保持交易简短并为父母的孩子手动查找?