Information regarding released record locks that are obtained in Apex using FOR UPDATE when you roll back to a savepoint that’s set using the Database.setSavePoint() method is now logged in the debug log
// Create a savepoint
Savepoint sp = Database.setSavepoint();
// Get the account to change
Account a = [SELECT ID, Name, AccountNumber FROM ACCOUNT WHERE Name = 'xyz' LIMIT 1 FOR UPDATE];
// Change the account number
a.AccountNumber = '123';
update a;
// Rollback to the previous value
Database.rollback(sp);
