Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

weird behaviour on findByPrimaryKey

 
Hector Rosas
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone, I thought that a findByPrimaryKey or any single record finder will throw a ObjectNotFoundException when the record doesn't exist on DB, but I noticed that doing a findByPrimaryKey on a table returns a EJB, it's not null, and it doesn't contains any info, but there's no way to know that the info isn't on DB. The only way a found to see if it's really an entity is to getSomeField and then catch a java.rmi.NoSuchObjectException to know if it's a false entity or a real. Does anyone here have the same behaviour? Hope someone can help. I'm using orion 2.0.7

Thanks.
 
Always! Wait. Never. Shut up. Look at this 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!