Kris,

From: Ramakrishna N <[EMAIL PROTECTED]>
Subject: Re: ejbCreate and CreateException in EJB 2.0
Date: Mon, 11 Mar 2002 00:31:29 -0500

> Hi,
>   Sorry ! I was not right when I said that EJB spec doesnt mandate that
> bean-provider may not have to throw a creatException from ejbCreate methods.
> It does mandate. It indicates that an application level error occured while
> the container is creating the bean. Additionally the bean-provider is
> recommended to mark the transaction for rollback only to play a safe
> game,FYI.

I've found a bug report about this CreateException issue:

  http://developer.java.sun.com/developer/bugParade/bugs/4460280.html

I reproduced this with Sun J2EE reference implementation 1.3.1
by applying simple CMP bean.

Now I'm really sure ejbCreate methods MUST have CreateExcption declarations.

>   May be in the code which you have seen, they must be throwing an
> Exception, a BusinessException that extends the CreateException and so may
> be you havent seen those words of CreateException.
>

I have seen many CMP entity ejbCreate methods without CreateException
declarations in following EJB books and their samples:

- Oreilly, Enterprise JavaBeans 3rd edition.
  (none of CMP ejbCreate methods has a CreateException declaration.
   see chapter 6. CMP 2.0 CMP)
- QUE, Special Edition Using Enterprise JavaBeans 2.0
  (This book says that we don't need to declare CreateException
        for ejbCreate in a development tip)
- Willey, Mastering EJB II.
  (see sample codes for CMP 2.0)

I must say I love all books above.
That's why I wasn't sure all samples were wrong.

Cheers,
Miki

===========================================================================
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".

Reply via email to