tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: CMP failed with 3 layered Object structure
Date Sat, 02 Jun 2012 20:40:17 GMT

On Jun 2, 2012, at 2:53 AM, georgenis wrote:

> I thought the container manage all database connections?! 

It depends.  There are two types of JPA, RESOURCE_LOCAL were the application does the management
and TRANSACTION where the container does the management.

A basic overview:

This looks like a lazy-loading/detach problem.  The relationship is marked as lazy and therefore
not loaded when the Entity is pulled from the database via the EntityManager.  To cause the
lazily loaded references to be loaded, the collection has to be referenced while the transaction
(either EntityTransaction or JTA Transaction) is still in progress.

If you can post the web service class I can give some better pointers on the best place to
do that.


View raw message