Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Useful points on exceptions in ejb 2.0

 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Just thought that the following points in regards to the exceptions could be useful for the exam preparations:

1. When a session or entity bean call getEJBHome/getEJBObject on SessionContext/EntityContext and the bean does not have a remote interface defined - Container throws java.lang.IllegalStateException

2. When a session or entity bean call getEJBLocalHome/getEJBLocalObject on SessionContext/EntityContext and the bean does not have a local interface defined - Container throws java.lang.IllegalStateException

3. Client gets RemoveException when
a. remove() is called on SFSB that is in a transaction (BMT sfsb)
b. remove(Object pk) is called on a session bean remote/local home intf
c. application level error occurred in ejbRemove() method of the entity bean

4. Client gets a RemoteException when calls getPrimaryKey() on session bean's remote component interface.
Client gets a EJBException when calls getPrimaryKey() on session bean's local component interface

5. Client gets a RuntimeException when extracts EJBMetaData from session bean's remote home interface and calls EJBMetaData#getPrimaryKey()

6. Container throws IllegalStateException when bean calls methods on EJBContext that are not allowed (eg, getEJBObject() from setSessionContext()) or when tried to reset pk, or when performing prohibited operation on java.util.Collection API that represents a cmr-field)

7. When a bean attempts to access a resource manager or other beans and the access is not allowed (accessing a resource in ejbActivate() of entity bean) the behaviour is undefined by ejb spec




[ July 03, 2004: Message edited by: Alex Sharkoff ]

[ July 03, 2004: Message edited by: Alex Sharkoff ]
[ July 05, 2004: Message edited by: Alex Sharkoff ]
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool complement to my cheatsheet on exceptions handling.
Thanks Alex
 
I am mighty! And this is a mighty small ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic