November 2018
Intermediate to advanced
388 pages
9h 5m
English
Exception handling is crucial for enterprise applications. Exceptions can arise in the middle of execution, such as a PersonCreationException in our example. Once an exception arises somewhere within the execution, the data will either be persisted in the database or the complete transaction will be rolled back, depending on the exception.
For example, let's say our createPerson() function throws PersonCreationException:
public class PersonCreationException extends Exception { public PersonCreationException(String message) { super(message)} }
Since PersonCreationException is a checked exception, the transaction will not be rolled back if the exception is thrown during the execution of the createPerson() function. These ...
Read now
Unlock full access