• Post Reply Bookmark Topic Watch Topic
  • New Topic

NoSuchObjectException or EntityNotFoundException

 
Peter Warde
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you call a method on an entity bean after having called remove() do you get a NoSuchObjectException or EntityNotFoundException ie is the bean in the "does not exist " state?

Thanks
 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You get a NoSuchObjectException or NoSuchObjectLocalException are thrown if the object is removed( which could mean the entity bean object he has a reference to/or the entity the object is refereing to which means the clients reference is void now) and client is calling a method on it, where as the NoSuchEntityException is thrown by the bean to the container during one of the callbacks/methods where it could not complete the operation because the entity is removed from the database(underlying persistent store). Hope this helps.

Regards
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!