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

Yorumlar

Popular

Dependency Injection In Java and CDI

Java EE Technology Stack

Servlet