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:
- 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.
- 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.
- Java EE 6 will not suffice if you need to build and app with good number of external configuration properties.
- 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.
- 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.
- I was feeling the need for those template classes when writing direct JPA code with entity manager.
- 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.
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.