zberentey/liferay-portal — pull request #156 by laszlocsontos (2012-10-23 14:33:07+00:00)
Title: [Technical support] LPS-30622

Hi,

In LockLocalService a race condition is possible, which might cause unique constraint violation exception, if two threads (or more than one node of a cluster) tries to acquire the same lock nearly at the same time. (In the customer's environment this behaviour prevents their cluster from booting).

The issue is easily reproducible: LockLocalServiceTest fails on trunk (GIT ID: 3cd9429080a2f47e9d05830dbe6900cacdebec5c).

If a lock record has been previously created, the secord INSERT causes unique constraint violation, however it's not a critical error and it should not hamper processing, thus after my change DML operations do not propagate ConstraintViolation-, LockAcquisition- and ObjectNotFound- exceptions to the caller, but these kind of "soft" errors are only logged as warnings.

Cheers,
Laci.