Checked & Unchecked Exceptions


Checked Exceptions
  • are subclasses of java.lang.Exception
  • need to be declared in a method or constructor's throws clause

Unchecked Exceptions
  • are subclasses of java.lang.RuntimeException
  • do not need to be declared in a method or constructor's throws clause

In the context of common transaction APIs, such as JTA or Spring transaction APIs;

any RuntimeException triggers rollback, and any checked Exception does not rollback the transaction.


Runtime
Rollback
Unchecked

Comments

Popular

The Convergence of OpenJDK and the Oracle JDK

It's Time For Faster Releases

Project Jigsaw