lessons learned in November 2017


Posted by Steven

This is what I learned in November 2017:

  1. One more cool shortcut for IntelliJ IDEA: Shift + Esc closes panels. Especially helpful in presentation mode.
  2. There is a very cool admin interface for Spring Boot applications, spring-boot-admin. It shows not only logs, health metrics and statistics, but can change log levels and even the spring configuration at runtime. The http request trace looks also very promising.
  3. At the last days of November, I was notified about a sale at Udemy. John Thompson sold all of his Spring workshops for only 10€ each! I bought all of the courses I didn't bought already. Now I can learn a lot about Spring from great videos and exercises for only a handful of Euros. Great!
  4. Recently, I ran into an "IllegalArgumentException: Removing a detached instance x.y.z.MyClass" in my main project, which uses Spring Data JPA. I wanted to delete an object I just loaded from the database via a find()-method in a repository. I wondered how a recently loaded object could be detached. A coworker analyzed the issue and found  out, that the object hasn't really been loaded from the database. Instead, in an earlier method, it was created using the Dozer bean mapper. At this point, it was not attached to a hibernate session. Then, it was added as an attribute to another object that was part of a hibernate session. Now, there are two objects with the same database ID, but different object IDs, which lead to the mentioned exception. Lessons learned here: Never create objects that exist in the database by hand. Instead, load them from the database.

(Photo: adrian825http://www.istockphoto.com/photo/monthly-management-reports-36658768)

Category: 
Share: