Hello Parvesh, The schema is like this<key internal="true" name="PrimaryKey"><keyfield xpath="@PK"/></key><attribute advanced="true" autoIncrement="true" name="PK" type="long"/> The first time I insert something in db, it works properly, but after that it gives me error (as the PK value keeps at 0)