I would say that an app server that rolls back on an application exception shouldn’t pass the compatibility tests.
/Johan
Den 2002-12-16 17.27, skrev "Juan Pablo Lorandi" <[EMAIL PROTECTED]>:
Depends on the kind of transaction, and the EJB spec you're working against. Best is to do both: mark the transaction for rollback, then rethrow the exception; just rethrowing the Exception will work with most app servers and is a good programming practice.
Sample:
try {
// some code
} catch (SomeException e) {
log.error("While doing Something", e);
ctx.setRollbackOnly();
throw AppException("While doing Something", e);
}
My 2c,
Juan Pablo Lorandi
Chief Software Architect
Code Foundry Ltd.
[EMAIL PROTECTED]
Barberstown, Straffan, Co. Kildare, Ireland.
Tel: +353-1-6012050 Fax: +353-1-6012051
Mobile: +353-86-2157900
www.codefoundry.com <http://www.codefoundry.com/>
Disclaimer:
Opinions expressed are entirely personal and bear no relevance to opinions held by my employer.
Code Foundry Ltd.'s opinion is that I should get back to work.
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]] On Behalf Of BOUTTE Sebastien
Sent: Monday, December 16, 2002 4:02 PM
To: [EMAIL PROTECTED]
Subject: CMP Transactions
Hi,
I would like to know if i have to called method setRollBackOnly on session context
when i want to rollback current transaction or rethrow the exception to the container, and let it do the rollback ?
Thanks
Sébastien Boutté
Ce message est protégé par les règles relatives au secret des correspondances ; il peut en outre contenir des informations à caractère confidentiel ou protégées par différentes règles et notamment le secret des affaires ; il est établi à destination exclusive de son destinataire. Toute divulgation, utilisation, diffusion ou reproduction (totale ou partielle) de ce message, ou des informations qu'il contient, doit être préalablement autorisée. Tout message électronique est susceptible d'altération et son intégrité ne peut être assurée. WFinance et WFinance Conseil déclinent toute responsabilité au titre de ce message s'il a été modifié ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur de l'erreur de distribution et de la destruction du message.
This message is protected by the secrecy of correspondence rules ; furthermore it may contain privileged or confidential information that is protected by law, notably by the secrecy of business relations rule ; it is intended solely for the attention of the addressee . Any disclosure, use, dissemination or reproduction (either whole or partial) of this message or the information contained herein is strictly prohibited without prior consent. Any electronic message is susceptible to alteration and its integrity can not be assured. WFinance and WFinance Conseil declines any responsibility for this message in the event of alteration or falsification.. If you are not the intended recipient, please destroy it immediately and notify the sender of the wrong delivery and the mail deletion.
