Why use a ReentrantLock if one can use synchronized(this)?

A ReentrantLock is unstructured, unlike synchronized constructs — i.e. you don’t need to use a block structure for locking and can even hold a lock across methods. An example: private ReentrantLock lock; public void foo() { … lock.lock(); … } public void bar() { … lock.unlock(); … } Such flow is impossible to represent via … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)