• Post Reply Bookmark Topic Watch Topic
  • New Topic

weird behaviour on findByPrimaryKey  RSS feed

 
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!