• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create Exception

 
Arun Natarajan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page 549 in HFEJB says that when a CreateException is thrown the client cannot be certain that the bean was not created, because the exception might have
happened after the transaction commited. If that is the case then how do you handle this scenario in applications using entity beans? Do you code the client so that whenever a createException is thrown you check whether entity was created??

Thanks,
Arun N
 
Ugender Rekulampally
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arun,
I guess, in entity bean scenario, you use transaction to create/insert a row
in the data base, so that should give you an idea wether transaction rolled back or successful. But you may want to do some thing in ejbPostCreate as well to make sure the entity is there since it will be called right after ejbCreate.

and in session bean scenario, I guess there is nothing we can do till you get some kind of exception when you try to call methods on your component interface (either NoSuchObjectException if atleast when there are stubs but not the bean instance or RemoteException/EJBException when there is a problems creating stubs itself).

Thanks,
Ugender
[ September 21, 2006: Message edited by: Ugender Rekulampally ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic