Re: ejbCreate and ejbPostCreate Exception handling.

"Naik, Vikram" <[email protected]> Mon, 18 Apr 2005 11:23:23 -0400
Newsgroups gmane.comp.java.sun.ejb.general
Message-ID <[email protected]>
The rollback was verified by firing a finder in separate transaction. Even checked the database no row was inserted.

Vikram.

-----Original Message-----
From:   Johan Eltes [mailto:[email protected]]
Sent:   Mon 4/18/2005 5:06 PM
To:     [email protected]; Naik, Vikram
Cc:	
Subject:        Re: ejbCreate and ejbPostCreate Exception handling.
I would not expect the container to rollback based on any checked exception. How did you verify the rollback?

/johan

---------- Original Message ----------------------------------
From: "Naik, Vikram" <[email protected]>
Reply-To: "Naik, Vikram" <[email protected]>
Date:          Mon, 18 Apr 2005 10:52:21 -0400

>Hello All,
>
>I have an EntityBean CMP 2.1, deployed on JBoss 3.2.5. 
>
>The create method of this entity bean is invoked from an Stateless session bean, with transaction demarcated with attribute "Required".
>
>When an application exception is thrown from ejbCreate method, the container rollbacks the transaction by default.
>
>But if an application exception is thrown from ejbPostCreate method, the container doesnt rollback the transaction by default the client have to invoke setRollBackOnly to rollback the transaction. 
>
>Does that mean, any businesslogic which requires to throw an application exception and not rollback the transaction when an entity bean is created should be placed in ejbPostCreate ? 
>
>The EJB Specs 2.1 says if an application exception thrown should enable the client to have control over transaction, but in case of ejbCreate it doesn't seems so doing it.
>
>Any thoughts on the above would be appreciated.
>
>Thanks,
>Vikram.
>
>===========================================================================
>To unsubscribe, send email to [email protected] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[email protected] and include in the body of the message "help".
>
 

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".