Skip to main content

End of Java EE 6 show

Since last 2 days I have had lot of issues integrating JPA2 with my SLSB. Some of these are attributed to my new learning curve in Java EE 6. However with my quick exploration in last few days I can safely say that there are still serious holes in Java EE 6 world. It is slim trim and good for rapid development (unless you are on some unstable open source server) but lacks full power to drive a highly customizable and external configuration driven flexible application. These are some of my observations:

  1. Open source servers – Geronimo 3 and JBOSS 6 not yet ready. JBOSS 6 is still better. Guys for better adoption of open source we need documentation. Open source product and closed documentation will not promote this good products.
  2. Directly injecting persistence unit / entity manager results in severe cross cutting concerns. I take back my earlier word, although speed of development is important, good design goes a long way in maintenance. After writing some code in my session bean with JPA I was sad myself.
  3. Java EE 6 will not suffice if you need to build and app with good number of external configuration properties.
  4. Security – although I did not try much, but looks like is not as strong in terms of features that Spring security provides – especially easy integration with directory servers or SSO systems.
  5. If I want to clean up my session beans by moving data access code to a DAO, then I would have to build a factory to inject it. Ah Spring does a better job here. Does Java EE 6 promote code smell? I guess YES.
  6. I was feeling the need for those template classes when writing direct JPA code with entity manager.
  7. I had problems using the POSTGRES data source configured using JBOSS 6 console. The persistence unit could never connect. Finally I had to resort to old days of copy+paste the xml in the deploy directory.

Final conclusion

I am rolling back to stick to Spring 3 on Tomcat 6/7 with Primefaces and Hibernate or my home grown data mapper. I will also use JQUERY UI and JQUERY Mobile if my requirements are that way. I may consider JBOSS 5 / 6 if  there is need for JMS / MQ and there is multiple resource managers calling for JTA. But all core will be Spring. I think lot of dust has to settle over Java EE 6, even then it will still take lot of time to match the pluggability, flexibility and wide coverage of Spring with other good frameworks.

Next focus will on my own simple data mapper. I will put it on source forge.


  1. You probably have to use GlassFish v3, instead of rolling back to the trouble. :-)

  2. Yes it is good. It does away with the technical glitches or platform implementation bugs, but still not usable for a configurable, pluggbale product.


Post a Comment

Popular posts from this blog

Why do you need Spring Cloud Config server?

Last month I wrote a primer on concepts around 12 factor app. Before getting into the details of the Spring Cloud Config Server, I must refresh on the principle #3 from the list presented in that post.

3 – ConfigurationStore config in the environments
Configuration information must be separate from the source code. This may seem so obvious, but often we are guilty of leaving critical configuration parameters in the scattered in the code. Instead, applications should have environment specific configuration files. The sensitive information like database password or API key should be stored in these environment configuration files in encrypted format.
 The key takeaways from this postulate for a cloud-native microservices application are:
Do not store configuration as part of the deployable unit (in the case of lead microservice - inside the jar or war if you are still deploying war like the good old days). Instead, store it in an external location and make it easily accessible during run-…

Upgrading Lead Microservice - Use MariaDB and Flyway with Spring Boot

So far I have been using an in-memory H2 database or Mockito for testing the lead microservice. To make the transition towards using the Spring Cloud Config server, I need to upgrade the micro-application to use MariaDB. I will be adding the configuration in the application.yml  the file which in the subsequent post will move over to the config server store. I will also be using Flyway to make it easy to maintain the database schema changes in future. I will use this post to introduce Flyway in the mix. Spring Boot also provides first class integration with Flyway. I am using Flyway as its really quick and easy to get started, minimal learning curve (no DSL) and I am comfortable with it having used it in the past.


MariaDB 10 is installedBasic familiarity with FlywayHeidi SQL client is installed.
Step 1 - Update build.gradle to include the MariaDB JDBC and Flyway dependencies.
Do not forget to do a Gradle refresh on your IDE (I am using STS 3.8.4 on Java 8)

Step 2 - Rename the…

How to implement Cache Aside Pattern with Spring?

ProblemYou want to boost application performance by loading data from a cache and prevent the network trip to the persistent store (and also the query execution). This can be achieved by loading data from a cache. However, you want to load data on demand or lazily. Also, you want the application to control the cache data management – loading, eviction, and retrieval. Forces Improve performance by loading data from cache lazily.Application code controls cache data management.The underlying caching system does not provide read-through, write-through/write-behind strategies (strange really ??).
Solution Use cache aside design pattern to solve the problems outlined above. This is also one of many caching patterns/strategies. I believe it is named in this because aside from managing the data store, application code is responsible for managing the cache also.
Let's now try to understand how this caching technique works and then explore how it solves the problems.
ReadCache MissThe applic…