use cgaEventAccessSqlLock to generate sn.
enable cgaEventAccessSqlLock (reverted from commit f9dbfb9486627d5479df53564247134070e3cb14)