when using pessimistic locks, we rely on the Database locks. So you most likely want to read about transaction isolation levels, they are implemented at database level:
http://en.wikipedia.org/wiki/Transaction_isolationIn short, a pessimistic lock will acquire the lock on the records you're reading as soon as you read them, and so if another thread is going to change one of these it's blocked until you're done with your current transaction: so changes are sequential and no issues happen. This strategy is safe but will obviously degrade performance, and in some cases you want to manage it differently.
So using optimistic locking is a known alternative, usually a bit cumbersome to implement so Hibernate provides native helpers for it.
Up to you which one to choose, no one is mandatory.