We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ae9e3e commit 871df4fCopy full SHA for 871df4f
cqrs/src/main/java/com/iluwatar/cqrs/commandes/CommandServiceImpl.java
@@ -24,6 +24,7 @@ private Author getAuthorByUsername(String username) {
24
author = (Author) query.uniqueResult();
25
}
26
if (author == null) {
27
+ HibernateUtil.getSessionFactory().close();
28
throw new NullPointerException("Author " + username + " doesn't exist!");
29
30
return author;
@@ -37,6 +38,7 @@ private Book getBookByTitle(String title) {
37
38
book = (Book) query.uniqueResult();
39
40
if (book == null) {
41
42
throw new NullPointerException("Book " + title + " doesn't exist!");
43
44
return book;
0 commit comments