Conforming to JPA 2.1 for persistence, a practical experience

Calcey is currently engaged in the challenging task of overhauling the persistence layer of the software platform for a leading multi-player gaming company based in Silicon Valley. The client’s Java-based software infrastructure is a complex blend of different technologies such as Spring Framework, JSP, Tapestry, HiveMind, Hibernate, Oracle, MySQL and PostgreSQL. The versions of some of these frameworks used are deprecated and have been targeted for gradual replacement by the client. Discussions took place on how to maintain the platform tiers independent and flexible for different technologies. There was particular concern about the persistence layer of this platform, which had been wired using outdated Hibernate 3.1 technology.

The Hibernate framework is used for mapping object-oriented entities with a relational database. Being open-source software, Hibernate has its advantages and disadvantages. The main disadvantages of Hibernate are:

  1. It is an open-source solution framework and often goes through model revamp. Upgrading from an older version of Hibernate to a newer one can prove to be very difficult owning to the frequent changes in hibernate specific API’s.
  2. Switching from the Hibernate persistence framework to another alternative is time consuming, due to its proprietary query language and annotations.
  3. The custom implementations of certain Hibernate features like caching introspection are not mature and are possibly earmarked for deprecation.
  4. It is the industry standard today for the ORM layer to be unbounded by a specific technology.

After all, keeping one’s application layers simple, independent and swappable is an architectural principle that an organization would aspire to have. So a goal was set for Calcey to migrate the existing JPA incompatible ORM layer to meet the JPA 2.1 standard. The migration would ensure that the ORM layer was independent of Hibernate specific class libraries, thus enabling easy configuration of different ORM technologies such as Eclipse Link or MyBATIS.

Migrating from one ORM to another can be a simple task once JPA is implemented, as is demonstrated below:

The Calcey team did a preliminary assessment of the interfacing points in the code base (with the ORM layer) and decided to initially migrate from Hibernate 3.1 to Hibernate 3.5 (Hibernate 3.1 which does not meet the complete JPA standards and is buggy). Thereafter, the team stepped into refactoring the code in earnest –  a time consuming task due to the many data calling points within the other architectural layers of system, often occurring from different frameworks such as Tapistry and HiveMind.

A team of two developers and a tester are dedicated to this project, which happens to be my first project management assignment at Calcey. We have scoped out the requisite changes over a somewhat longer period of time, to manage the regular feature implementation requests in parallel to this important refactoring exercise. Calcey hopes to complete this refactor in the coming three months.

Life at Calcey

Calcey helps ease the pain in kids who have cancer

Calcey Technologies has made a commitment to help Kids with Cancer in the Maharagama Cancer Hospital, where any employee of Calcey can volunteer and contribute to this valuable cause along with the company.

Cancer is a deadly disease, which can inflict great pain to its victims if it reaches the terminal stage. When little kids get cancer the resulting human suffering is immense because both the child as well as its loved ones undergo psychological and physical trauma. Early diagnosis and treatment is the only way to alleviate this suffering in children with cancer.

Sadly, the very treatment procedures themselves are painful and hard for a little kid to endure. Chemo treatment requires the little ones to endure regular hypodermic injections over long periods of time. Getting a sharp needle stuck into one’s veins daily is not fun for a child. Often the veins are not visibly on the surface of the skin, and doctors have to make several attempts to successfully inject the medicine.
There is a neat solution to ease the pain caused by a regime of injections, called a “Port” 1. This Port will last for a year and a half, or until the end of the treatment regime, and thereby help the kids go through it with less pain. However, most of the parents of child cancer victims cannot afford this solution.

The employees of Calcey Technologies, along with its Directors have made a commitment to help minimize the suffering of children during their chemo experience, by donating two Ports per month. Their monthly contributions support buying Ports for kids in the Maharagama Cancer Kids ward, through the “Cancer Care Association”  –  a Not For Profit organization that is committed to Cancer Care. The Cancer Care Association has already taken the initiative to negotiate with an Austrian supplier to provide Ports for a specially discounted price (the Original price being $500, the discounted price is $200 or approximately LKR 23000).

Each Calcey employee has given their explicit consent to deduct a certain amount of money from their monthly salary, and the Company tops up the balance to meet the cost of two ports, and honour its commitment for Cancer Kids. Even though the contribution that a single employee makes is relatively small, the Calcey commitment helps minimize the suffering in children, which is truly commendable.

1. The Port: http://en.wikipedia.org/wiki/Port_(medical)
(Image Courtesy Wikipedia: http://en.wikipedia.org/wiki/File:PAC_met_Gripper_erin.JPG)