I am new to JPA and have some questions on correctly using listeners.
I have an entity bean that shall do two things:
(1) As soon as INSERT was done, its GeneratedValue ID shall be written
into another data field. But if I try to modify any field inside of
@PostPersist, those changes never occur in the database. Isn't it
allowed to change an object after it got persisted? Or am I the only one
that needs to have the generated valued copied in another field?
(2) As soon as INSERT was done, a JMS message shall be sent. But how to
obtain a JMS session inside of a EJB 3.0 entity (I knew how to do it in
EJB 2.1)?
I know I can workaround by modifying the calling code. But as I am
programming a third party library, my customers shall not be forced to
do all those things manually in their calling code.
Any ideas?
Thanks
Markus
--
QUIPSY QUALITY GmbH & Co. KG
Ein Unternehmen der MES-Gruppe
Stuttgarter Strasse 23
D-75179 Pforzheim
Tel: 07231-9189-52
Fax: 07231-9189-59
www.quipsy.de
karg_at_quipsy.de
Registergericht Mannheim HRA 701214
Geschäftsführer: Nils Schroeder
Diese E-Mail enthält persönliche, vertrauliche und vor Weitergabe geschützte Informationen und ist ausschließlich für den vorgesehenen o.g. Empfänger (Adressaten) bestimmt. Falls Sie diese E-Mail versehentlich erhalten haben und nicht der vorgesehene Empfänger sind, bitten wir Sie, die E-Mail und deren Anhänge nicht aufzubewahren, nicht zu vervielfältigen, nicht zu nutzen und nicht weiterzugeben. Bitte informieren Sie uns als Absender über diesen Zustellungsfehler und löschen Sie die E-Mail.