Santiago Gala wrote:
> 
> I have a problem with the semantics of ejbCreate with CMP:
> 
> Let's assume that, in the ejbCreate method of a CMP entit bean, we
> create some auxiliary entities.
> Let's assume that, after the ejbCreate method returns, Jonas receives a
> SQL Exception due to a problem with the database (for example a
> DuplicateIndexException).
> 
> Should not Jonas rollback a transaction covering all activity (including
> any actions performed inside ejbCreate?
> 
> I observe behaviour where the bean is not created, but the auxiliary
> objects remain in the system in Jonas 1.6.1
> 
> Does the spec say something about that?
> 
Hi Santiago,
I think that the correct behavior is described in the EJB1.1
Specification
in the § 12.3.1 and more precisly in the Table 8 page 191.
ejbCreate is considered to be a business method.
The behaviour of the container depends on:
- the nature of the exception raised (Application Exception or 
  System exception and errors)
- the transactional attribute.

You can see for example that the container must mark the transaction 
for rollback and throw TransactionRolledBack exception when it is a
SystemException
or Error raised during the ejbCreate and if ejbcreate is running in the
context
of the caller's transcation (Required, mandatory, Supports).
But with the same transactional attributes, if the exception raised
is an application exception, the container re-throw the exception
and it's up to the client to decide to commit/rollback the transaction.

I think that JOnAS 2.0 follow strictly the behavior described in this
table.
Note that in the previous versions of JOnAS the methods defined in the
home interface was not considered to be business methods, and the
behavior
was incorrect in such situations. It is now fixed.

Best regards,
-- 
        Philippe

Philippe Coq  Groupe Bulll/BullSoft/OpenMaster  Phone: (33) 04 76 29 78
49
Bull S.A  - 1 rue de Provence - 38432 Echirolles Cedex France
[EMAIL PROTECTED]  http://www-frec.bull.com
Download our EJBServer at http://www.bullsoft.com/ejb
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to