This week's giveaway is in the Beginning Java forum.
We're giving away four copies of Bad Programming Practices 101 (e-book) and have Karl Beecher on-line!
See this thread for details.
Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exceptions to be trown inside DAO Layer wen using Spring  RSS feed

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi , i had difficult time understanding what kind of exceptions to be thrown inside the Spring DAO Layer .

DataAccessException is a runtime exception .

How can i handle ApplicationExceptions say (UserAlreadyExistsException ) should i throw this under the DataAccessException??

Thanks in advance .
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can check and throw UserAlreadyExistsException outside DAO.
UserAlreadyExistsException needn't to extend from DataAccessException.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much.
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!