Hibernate is a mature ORM tool for Java environments and is Free under LGPL. Hibernate lets you map your Java classes to database tables, and also provides data query and retrieval facilities. This article will focus on data query and retrieval facilities. I will not go into detail about how a query might be built and instead focus on some other things that a developer should have in mind.
The term session is a central part of the framework. The sessions lifecycle can span several database transactions and is the place where you create, read, update, delete instances of your mapped entity classes. Instances of your java classes can exist in three different states. Transient: An instance is transient when it at no point in time has been persisted with the session e.g when a new instance is made in your application. Persitent: An instance is persistent when it is associated with a session. Detached: The instance has previously been persisted but is currently not associated with a session.
I recently had a cooperation with some colleagues from the Oracle team, putting together a document with some guidelines and tips for working with Hibernate/JPA and Oracle from a performance point of view. I decided to take some of these general guidelines and tips for Hibernate/JPA to do a three part serie with blogposts here on our blog. Each topic is divided into three parts; problem, suggestion and value. Each topic evolves from a identified problem and then makes a suggestion for dealing with the problem and a value for what benefits you get from using the suggestion. Anyone working with Hibernate or JPA should take some of these guidelines and tips under consideration. They are not just for improving performance. Some are more general best practices to ensure quality, easier coding and performance.
Previously, I have written about my current project, a system used by Stockholm Country Council for computing compensation from the county to the various health care providers within the county for services provided to the people of Stockholm. I have also mentioned previously that I have taken the role of de facto Scrum Master. In addition, I have become the de facto test manager in the team. The system does not really have users per se, but rather, it takes input in the form of XML files, it makes a bunch of calculations on this data and then it spits out some new XML files. Read more…
One month ago, I wrote this short post about how the Java Team at Kentor was about to officially take over the management and continued development of one of the most important health care billing systems in Stockholm County. Now we have been at it for a month, and things have gone relatively smoothly, with the occasional incident and one considerable change in project organisation. Read more…
I had a really great experience today where I got to take part in a workshop where six hard-core Oracle profiles sat down with six hard-core Java/Hibernate profiles and tried to analyze and come up with a solution to a particular customer’s performance-scaling problems. Time is critical (when is it not?) and the customer only has a few weeks to sort out the problem prior to a very high-profile launch.
As one might expect, the Oracle consultants were very much focused on improving performance by focusing on the database, introducing new packages and stored procedures. Similarly, the Java consultants were very much focused on Hibernate, how the customer has used and configured it, and how we could help the customer to trim it even more. Read more…
I recently read this article and this article about how to choose an integration framework and/or when to write a custom solution in Java. The articles compare the alternatives and discuss the pros and cons on Spring Integration, Mule ESB and Apache Camel. Some of the criteria for comparison are:
- Open source
- Basic concepts / architecture
- Commercial support
- Enterprise readiness
- Domain specific language (DSL)
- Number of components for interfaces, technologies and protocols
So a pretty extensive list. As I was reading the articles, I realized that I since I started with project and team management, I am not nearly as well versed as I used to be in all the details of the various Java frameworks available when building Enterprise applications in Java. There are also plenty of good Java developers out there who are very good at Java but who don’t have the experience of working with a plethora of frameworks.
This got me thinking in more general terms about how one chooses not only integration frameworks (as discussed in the above articles) but frameworks in general. When does one choose Struts and when does one choose Spring MVC? When should we use Spring Batch and when should we implement our own batch solution or use a DBMS based batched solution like SQL Server Integration Services? Is open source always best? Are the criteria above a good set of guidelines to follow when choosing any framework?
De senaste dagarna har jag jobbat med att sätta ihop en wiki för ett projekt som jag leder och där vi använder Scrum. Jag lånade min “definition of done” från ett annat projekt här på Kentor och den inkluderar följande punkt:
Ingen utökning av den tekniska skulden i ny kod
Jag har alltid gillat den där metaforen tekniska skulden, och jag bestämde mig för att läsa om denna två år gamla bloggpost av Martin Fowler som handlar just om den tekniska skulden i programkod. Read more…