Friday, 22 June 2012

My Next Course: Hibernate and JPA

This course has now been released (on Feb 14 2013) - full details here I've been working on projects for the last few months, so it's been a while since I created a new course.

I've agonised what to go for - there are so many vibrant and interesting topics I can cover, but I've decided to create a course covering both Hibernate and JPA in full detail.

We have already covered Hibernate in a little detail on our Spring Fundamentals course, and we do some JPA on the JavaEE course, but really we just provide overviews on those courses and we don't get to a full professional standard.

Hibernate and JPA need a course in their own right, and it's probably the most asked-for course from our customers, so I'm into the studio on Monday morning to start work.

As always, our video courses take a while to record and edit, we work hard to get them right, so it will be at least 2 months before we're ready to release. In the meantime, here's the draft running order - please contact me if there are additional topics that you want to see on the course!

  1. Getting Started
  2. Persisting objects
  3. Relationships in Hibernate/JPA
  4. Bidirectional Relationships
  5. Implementing equals() and hashCode() correctly
  6. Mapping Inheritance Hierarchies
  7. Embedding Objects
  8. Queries using HQL / JPQL
  9. Using the Criteria API
  10. Detached Objects and Merging
  11. Versioning Objects and Locking
  12. Understanding Lazy Initialization
  13. Hibernate/JPA in Web Applications (OpenSessionInView/OpenEntityManagerInView)
  14. Extended Sessions and EntityManagers
  15. Hibernate Caching (and the second level cache)
  16. Hibernate Validators
  17. Introducing Hibernate Search
  18. Auditing with Envers

Wednesday, 20 June 2012

Using Apache ActiveMQ in Glassfish

In our recent Java Messaging with JMS and MDB training course, we used Glassfish to send and receive messages using JMS.

The course covers the important topics of messaging, but one restriction was that the default message broker in Glassfish is lacking some of the features that many of the leading message brokers offer.

The big example is that in the chapter on MDB transactions, we have a message return to the queue if the MDB throws an exception. This allows us to "retry" an operation, say if an external system is unreliable.

That's great, and we get that working in the course, but the trouble is that the message immediately gets redelivered. So we end up retrying the operation straight away. What I really wanted was to delay the message redelivery by say an hour, so that the external system has time to recover.

Not possible in the default message broker in Glassfish. So it would be a good exercise to change the default broker. A good choice is Apache ActiveMQ, one of the most feature rich brokers in existence.

This excellent blog post from Sven Hafner describes how to do this - if you've followed our course and want to try this out, do let me know how you get on!