In this article, we will introduce the problems and recommended solution for persistence layer code when it is written in the service class in Java servers.