For example I have entity extracted开发者_运维知识库 from hibernate session User user = session.getById(12); user.setName('new_name') reject request
After this code block I do not want to store updates to user and use it purely as Data Bean but also I do not want to detach it from session because I want lazy loading. For modification i want to use methods save, saveOrUpdate. Is it possible to said hibernate not to automatically update all modified fields of session objects?
FLUSHMODE.MANUAL only flushes if you specifically say to, I believe.
You can use stateless sessions. They don't do any dirty checking and corresponding auto-magic updates. Obviously, you would lose session cache (you can keep track of your objects yourself) and batched inserts/deletes/updates.
精彩评论