aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Doubt: Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Doubt: Exception" Watch "Doubt: Exception" New topic
Author

Doubt: Exception

Mina Syal
Ranch Hand

Joined: Jun 24, 2004
Posts: 31
- Invoking javax.ejb.EJBLocalObject.getPrimaryKey() on a session bean results in javax.ejb.EJBException been thrown.
- Invoking javax.ejb.EJBLocalHome.remove(java.lang.Object primaryKey) on a session bean results in javax.ejb.EJBException been thrown.
- Invoking javax.ejb.EJBHome.remove(java.lang.Object primaryKey) on a session bean results in java.rmi.RemoteException been thrown.
- Invoking javax.ejb.EJBObject.getPrimaryKey() on a session bean results in java.rmi.RemoteException been thrown.


Any methods associated with a primary key defined by a local home or component interface raises a javax.ejb.EJBException if the method is invoked on a session bean. Likewise, any methods associated with a primary key defined by a remote home or component interface raises a java.rmi.RemoteException if the method is invoked on a session bean.

Is the above statements correct?
Nitin Mehhta
Ranch Hand

Joined: May 18, 2004
Posts: 48
Yes I think so.
Mina Syal
Ranch Hand

Joined: Jun 24, 2004
Posts: 31
But specs says:
Because session objects do not have primary keys that are accessible to clients, invoking the javax.ejb.EJBLocalHome.remove(Object primaryKey) method on a session results in the javax.ejb.RemoveException.

confused...:-( pls help...
Nitin Mehhta
Ranch Hand

Joined: May 18, 2004
Posts: 48
Hi,
Can you please quote the point where the specs specify this. Because I firmly believe that in such a case a Remote or an EJB Exception is thrown based on local and home interfaces. But then again nothing is above specs, it's just that sometimes we misinterpret them. Happens all the time with me.
Mina Syal
Ranch Hand

Joined: Jun 24, 2004
Posts: 31
Its in section 6.3.2 and 6.4.2... pls check...
Nitin Mehhta
Ranch Hand

Joined: May 18, 2004
Posts: 48
I guess You are correct. On further introspection I found the same thing written on Page 130 of the HF EJB book. I'm sorry for misleading you in the beginning and thanks for bringing this up, as I also am planning to take the exam sometime next week.
Mina Syal
Ranch Hand

Joined: Jun 24, 2004
Posts: 31
Thanks... even I am planning to give exam in next week... but still feel so many things are not clear...
 
jQuery in Action, 2nd edition
 
subject: Doubt: Exception