Large enterprise applications that serve large number of users, without a doubt, have to be able to scale to keep up with the demand. There are various ways of accommodating scalability requirements. Let's discuss those here.
When working in a clustered environment, you need to be aware of how it could impact Hibernate. One thing that could be impacted by deploying in a clustered environment is identity generation. If you use an increment strategy for ID generation even in a thread-safe mode, you are still not guaranteed uniqueness. Even if you use UUID using
java.util.UUID, the likelihood of collision is still there, though very minimal.
Another consideration is when dealing with detached entities. If you keep detached entities ...