Hi,
I have this code
public Response deleteNotification(@PathParam("nid") int notificationId) {
AlertNotification notification =
notificationMgr.getAlertNotification(caller,notificationId);
AlertDefinition definition =
alertDefinitionManager.getAlertDefinition(caller,notification.getAlertDefinition().getId());
definition.getAlertNotifications().remove(notification);
alertDefinitionManager.updateAlertDefinition(caller,definition.getId(),definition,true);
entityManager.flush();
Which always bails out with javax.persistence.OptimisticLockException:
org.hibernate.StaleStateException: Batch update returned unexpected row count from update
[0]; actual row count: 0; expected: 1
I have tried dozens of ways, but always end up with an error.
When removing a notification in the UI, the AlertDefinition that is passed into
updateAlertDefinition() also just does not
have the notification set anymore.
Any ideas?
Heiko
--
Reg. Adresse: Red Hat GmbH, Technopark II, Haus C,
Werner-von-Siemens-Ring 14, D-85630 Grasbrunn
Handelsregister: Amtsgericht München HRB 153243
Geschaeftsführer: Mark Hegarty, Charlie Peters, Michael Cunningham, Charles Cachera