#167 use a serializable cursor to check for PK duplicate