Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt: Exception

 
Mina Syal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- 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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I think so.
 
Mina Syal
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its in section 6.3.2 and 6.4.2... pls check...
 
Nitin Mehhta
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks... even I am planning to give exam in next week... but still feel so many things are not clear...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic