• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

mock question answer

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I came across a question which says following is correct answer.

public void ejbCreate(String userid) throws InvalidUseridException
{
if(userid.length() == 0) throw new InvalidUseridException(userid);
}

But should it NOT ejbCreate() always throw CreateException?

Thanks,
Prashant
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The CreateException is optional, unless you declare a throws clause with CreateException. (See spec 96)
 
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think its more like this:

CreateException MUST be specified in the throws of a create method in the component (local and remote) interfaces of both session and entity.

CreateException MAY be specified in the throws clause of a session beans create method

CreateException MUST be specified in the throws clause of an entity beans create method

CreateException MAY be specified for a entity beans postCreate method.
 
reply
    Bookmark Topic Watch Topic
  • New Topic