-
1. Re: Problem with container managed relations on AS 7.1.1
jaikiran Apr 30, 2012 10:42 AM (in response to k_benary)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?
-
2. Re: Problem with container managed relations on AS 7.1.1
k_benary Apr 30, 2012 11:21 AM (in response to jaikiran)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
ejbSelect
s 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.
-
3. Re: Problem with container managed relations on AS 7.1.1
aloubyansky Apr 30, 2012 1:47 PM (in response to k_benary)The insert should occur after ejbCreate or ejbPostCreate the latest anyway (it used to be a specification requirement). Can you still see that happening in your case?
There is actually no reason for them to be re-loaded from the database in the same transaction.
How is the relationship mapped? Are the foriegn keys mapped to their own columns or to the primary key columns?
-
4. Re: Problem with container managed relations on AS 7.1.1
aloubyansky Apr 30, 2012 1:50 PM (in response to aloubyansky)Was the same application working in earlier JBoss versions?
-
5. Re: Problem with container managed relations on AS 7.1.1
k_benary May 1, 2012 6:31 AM (in response to aloubyansky)Here is a more detailed description of our problem posted earlier by a colleague: https://community.jboss.org/thread/198254
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.
-
6. Re: Problem with container managed relations on AS 7.1.1
k_benary May 3, 2012 10:33 AM (in response to k_benary)Now I can confirm that it worked with JBoss 5. I cannot tell for 6.x.
Did the details on the relation mapping help you? Do you need more information?
-
7. Re: Problem with container managed relations on AS 7.1.1
k_benary May 3, 2012 11:26 AM (in response to aloubyansky)Now I can confirm that it worked with JBoss 5. I cannot tell for 6.x.
Did the details on the relation mapping help you? Do you need more information?
-
8. Re: Problem with container managed relations on AS 7.1.1
aloubyansky May 5, 2012 1:22 AM (in response to k_benary)Ok, thanks for the confirmation.
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.
Thanks.
-
9. Re: Problem with container managed relations on AS 7.1.1
k_benary May 7, 2012 3:14 AM (in response to aloubyansky)I will try to prepare a reproducer. Seems to be the best way to get all details across.
-
10. Re: Problem with container managed relations on AS 7.1.1
k_benary May 9, 2012 6:10 PM (in response to aloubyansky)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.
But the reproducer should reveal all details. Where should I put it?
-
11. Re: Problem with container managed relations on AS 7.1.1
jaikiran May 9, 2012 10:16 PM (in response to k_benary)Please file a AS7 JIRA and attach it to it with the details.
-
12. Re: Problem with container managed relations on AS 7.1.1
k_benary May 22, 2012 4:41 AM (in response to jaikiran)Any news in this field? Has AS7-4761 a chance to get resolved in the near future? It's essential for our plannings.
Thanks, Klaus
-
13. Re: Problem with container managed relations on AS 7.1.1
jaikiran May 22, 2012 5:59 AM (in response to k_benary)I forgot about that issue. I'll take a look at it this week.