0 Replies Latest reply on Sep 7, 2006 5:56 PM by Vasu Chou

    Update gets called before Delete has problem if version is m

    Vasu Chou Newbie

      We have Version field in database tables and is maintained/update through database trigger everytime we update record in corresponding tables. In Entity beans for such tables we had annotated this field with @Version but made insertable and updatable set to false in @Column annotation. This way Version validation is done by hibernate but Version update is done through database trigger. But we have problem in case of Delete. When we delete record for such entity using EntityManager.remove(), it first call update which triggers Version update in database through trigger. Then call delete. But due to version conflict record is not deleted and exception is thrown. This happens for the entities which are having one-to-many relations i.e. collection field.