Skip to main content

Make JDO the "P" in CMP

Posted by johnreynolds on March 12, 2004 at 7:53 AM PST

Bruce Tate's article "For JDO, the Time Is Now" brings up many good points, but it misses a key concern of mine: Solutions that already incorporate Entity Beans would be painfully expensive to rearchitect as JDO solutions.

The J2EE specification for Entity Bean CMP should dictate the interface for using JDO as a persistence mechanism. This would allow developers to reliably introduce JDO below the Entity Bean level without impacting the overlying layers of their applications.

I am involved with a project that uses Toplink as the CMP mechanism for Entity Beans and have experienced the pain of incorporating a non-standard persistence mechanism. Bruce is not completely candid when he states that TopLink can be used as a snap-in replacement for EJB CMP; it's more like a hack-in or pound-in replacement.

The interface between the EJB container and an underlying persistence mechanism is not a part of the J2EE standard, so Oracle (formerly WebGain) has to craft unique versions every time the container (in our case WebLogic) changes. At times we have been unable to apply WLS Service Packs because they would break Toplink. This is a real maintenance and upgrade hassle.

A standard mechanism for using JDO as the "P" in CMP would avoid versioning problems between EJB containers and JDO implementations, and it would also enable the ability to truly snap-in competing JDO implementations (competition is a good thing).

On another note,
Bruce lobbies for the recognition of SQL in the JDO standard, and I heartily agree.
EJBQL and JDOQL just aren't up to snuff, and from my perspective they just aren't worth bothering with. SQL is not as "Java friendly" as the new query languages, but it is much more comprehensive and widely understood. It seems like a distraction to pursue EJBQL, JDOQL and JDBC rather then focusing on tools to help developers write good SQL.

All in all, I am delighted at the possibility of a JDO resurgence, but I hope that it expands to embrace fixing EJB CMP rather then just replacing it.

Update 1:

The problems that we have experienced due to the tight coupling between Weblogic Server and Toplink CMP have crossed the pain threshold to the point where we have commited to fixing the problem.

After careful analysis, we have determined that EJB CMP 2.0 can not meet our needs (primarilly due to the limitations of EJBQL) and the best option for us is to eliminate Entity Beans and use Toplink for Java directly from our session beans. This looks like a rather straightforward conversion for us. I'll keep you posted.

Update 2 (July 2004):

The EJB 3.0 spec's radical overhaul of CMP has so confused us that we've slammed on the brakes. We're going to maintain our current code for the next few months and wait for the dust to settle.

Related Topics >>