Java hibernate HQL query and nolock

Is there any way to run these queries, just like I added (nolock) prompt to them?

Solution

If you really need this, you want to do something similar:

session.connection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);

This is the same as a nolock

Before you do this, be really careful if you want to do a dirty reading Most people do this because it's what they've been doing, not because it's the right thing In particular, this has no effect on caching

Actually, there is a problem with this thread Read carefully before making a decision

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>