Locks the page when the transaction updates or inserts or deletes rows or keys.
Different kinds of locks in java.
As far as i know there are basically three different synchronization features in java.
A lock is a preventive software mechanism that other users can not use the data resource.
This is the lock that any thread aquires over nonstatic synchronized method.
Synchronized blocks in java are reentrant.
T1 in block t1 in block t1 end t2 in block t2 in block t2 end t3 in block t3 in block t3 end.
Row and key locks.
This is the lock that any thread aquires over static synchronized method.
And when we do we cannot change the locked values.
Any thread can invoke the synchronized method for different object other than the object that has invoked the synchronized method.
The types of locks in jdbc.
Class level lock.
Using these locks you can achieve concurrency.
These are used to lock a particular row.
There is two type of lock in java.
Every class in java has a unique lock which is nothing but class level lock.
If a thread wants to execute a static synchronized method then thread requires class level lock.
From javadoc of lock those are the implemented classes.
The thread can reenter any.
A semaphore with a single available token works equivalent to a lock.
Notice the synchronized this block in the inc method.
You can lock a record set of records database table table space etc.
Row and key locks.
This is called reentrance.
Following are the types of locking in jdbc.
Reentrantlock semaphores quite similar to locks but they provide a pool of permits which can be claimed to enter a critical section.
Jdbc java 8 mysql mysqli database.
This is called starvation.
Monitor objects used with synchronize keyword locks e g.
Understanding locks when threads in a process share and update the same data their activities must be synchronized to avoid errors.
Useful when updating the rows update insert or delete operations as they increase concurrency.