Fixes #2225
Merge pull request #2227 from pveentjer/lock-identifieddataserializable

Fixes #2225