To be honest, I have no clue about EJB2.x entity beans. So I'll have to check with someone who knows about the expected behaviour here. I'm not even sure what the "include-updates" behaviour is? Do you have a reference to that somewhere?

Sorry, but I have no "real" reference to this. Here is a snippet for Oracles Weblogic documentation:

"According to the EJB specification, updates made by a transaction must be reflected in the results of query-finders and ejbSelects issued during the transaction."

And tht is what we call "include-updates": Any EntityBean updated or created within a transaction X must be found by any (matching) finder within that same transaction X even if it is not yet committed.

There are some application servers, where you can explicitly configure this behavior (e.g. Weblogic). In earlier JBoss versions this behavior was inherent with no configuration option. The solution was quite simple: any modified EntityBean was flushed from the TX- bean cache into the database before a finders SQL execution started.

On AS7.1.1 our CMP/CMR test cases fail, because dependent CMR-related entities are not re-read within the creating transaction. This goes for 1:1 as well as for 1:n relations.

Re-reading the entity in another transaction produces the complete object graph as expected. This means: The CMR itself works. It's just that in-transaction problem which bothers us.

To be precise: We do not assume that this include-behavior fails in general, but just for those CMR related child entities.

It shows a one to many relation as an example. However, we know that it applies to one to one relations too. And yes, it worked with earlier versions. For sure with 4.2.2 (which is rather old, I know). We made some porting efforts to 5.x and 6.x earlier. But I am not sure if the whole test suite was successful then. I can let you know tomorrow.

Not enough details, though. You posted the general description of the CMR, but not the mapping details. Can you post the actual mapping for the two entity beans envolved and also how the relationship is mapped? How are the relationships established (in code)?

Which container configuration you are using and If you modified the standard container configuration, please, post those changes too.

Finally I got a reproducer. Took me some time to drill it down to the critical part. The crucial point is an instant access to the child relation immediately after creation. This garbles the relation for the rest of the creating transaction. In a new transaction everything is fine.