Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] A Question expected behavior for callback events

Hi,

Consider following code.

          tx.begin();
Employee e = em.find(Employee.class, EMPLOYEE_PK); // Find an entity
          e.setName("foo");    // Mutate it
em.remove(e); //Remove the entity (Looks silly here but a possibility)
          tx.commit();

I was expecting that a preUpdate event would not be raised for such case. EclipseLink does raise it. I am not able to think of a use case where the event can be useful. Infect if some one is performing audit logs on preUpdate events, this can actually trigger false entries. What do others think about this scenario?

Thanks,
Mitesh


Back to the top