Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Best Practices - Exception Handling Mechanism

 
Joe Harry
Ranch Hand
Posts: 10122
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have a persistence layer which looks up a JNDI datasource and executes the SQL queries. So in effect, all the persistence methods that I have should handle NamingException and SQLException. Now what would be the best practice to the caller which is usually my middle tier to handle such exceptions? or do I handle them in my persistence layer and throw another generic exception to my service?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I'd throw some sort of persistence exception to the next layer up.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic