![]() ![]() ![]() ![]() Hibernate provides mechanisms for implementing both types of locking in your applications. Pessimistic locking assumes that concurrent transactions will conflict with each other, and requires resources to be locked after they are read and only unlocked after the application has finished using the data. If the check reveals conflicting modifications, the committing transaction rolls back. Before committing, each transaction verifies that no other transaction has modified its data. Optimistic locking assumes that multiple transactions can complete without affecting each other, and that therefore transactions can proceed without locking the data resources that they affect. ![]() Your locking strategy can be either optimistic or pessimistic. In a relational database, locking refers to actions taken to prevent data from changing between the time it is read and the time is used. Versionless optimistic locking using OptimisticLockType.DIRTY.Versionless optimistic locking using OptimisticLockType.ALL. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |