-
1. Re: Double updates with CMR fields
juha Sep 9, 2003 1:55 PM (in response to sblaes)What version of JBoss are you using?
-- Juha -
2. Re: Double updates with CMR fields
sblaes Sep 10, 2003 11:54 AM (in response to sblaes)I'm using JBoss 3.2.1.
-
3. Re: Double updates with CMR fields
juha Sep 11, 2003 6:01 AM (in response to sblaes)Talked to alex, he's fixed one such issue so you may want to test if you see the same behavior with the latest 3.2.2RC3. It is possible there's another bug there too.
-- Juha -
4. Re: Double updates with CMR fields
sblaes Sep 12, 2003 8:29 AM (in response to sblaes)I apologize. I was actually using 3.2.2 RC2. I have both on my machine but forgot which one I was running through my IDE... :( So, if it's a bug, then it appears to be in 3.2.2 RC2 as well. I'll try building the latest version from CVS and see where I get there....
I'll also give 4.0 a shot. -
5. Re: Double updates with CMR fields
sblaes Sep 12, 2003 8:48 AM (in response to sblaes)The behavior is the same with 3.2.2 RC3.
-
6. Re: Double updates with CMR fields
aloubyansky Sep 12, 2003 9:03 AM (in response to sblaes)I will check it. Thanks.
alex -
7. Re: Double updates with CMR fields
sblaes Sep 12, 2003 12:49 PM (in response to sblaes)Awesome, thank you!
-
8. Re: Double updates with CMR fields
wolfc Sep 15, 2003 9:03 AM (in response to sblaes)Alex,
What's the latest news on this?
Carlo -
9. Re: Double updates with CMR fields
wolfc Sep 16, 2003 6:05 AM (in response to sblaes)Checking the source there is something which strikes me as being weird:
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge:
1220 public void setClean(EntityEnterpriseContext ctx)
1221 {
1222 ___if(!hasForeignKey())
1223 ______return;
1224 ___getFieldState(ctx).setClean();
1225 ___if(hasForeignKey)
1226 ______setCleanForeignKeyFields(ctx);
1227 }
If this doesn't have a foreign key then do nothing.
If this does have a foreign key do everything.
The check in 1225 is superfluous, which I find hard to believe. Maybe 1222 & 1223 should not be there?
I'll start checking cvs to see if I can find a reason. -
10. Re: Double updates with CMR fields
wolfc Sep 16, 2003 6:31 AM (in response to sblaes)1.43.2.5: fixed bug [630665] CMR within one transaction: CMR is considered dirty if the collection was changed but not the CMP fields that make it up (this doesn't work for zero primitives)
1.43.2.11: call setClean on foreign key fields when setClean() is called on CMR field.
(HEAD shows the same code.)
I'm almost convinced that both setClean & isDirty have wrong implementations. I'm going to work on a patch to test my assumptions. -
11. Re: Double updates with CMR fields
wolfc Sep 16, 2003 8:06 AM (in response to sblaes)My assumptions were partly wrong. (As was expected :-) )
The cmpFieldIAmMappedTo (JDBCCMP2xFieldBridge) is made dirty in setForeignKey (JDBCCMRFieldBridge).
Should the functionality of setForeignKey be in JDBCCMP2xFieldBridge?
and thus setClean of JDBCCMP2xFieldBridge should setClean the cmpFieldIAmMappedTo also?
For now I'll add this code to setCleanForeignKeyFields. -
12. Re: Double updates with CMR fields
wolfc Sep 16, 2003 8:35 AM (in response to sblaes)Looking good, but still I have a problem with bidirectional relations. Probably because of updateFKFieldsMappedToMe.
Hmm, I'm gonna need a little help here. -
13. Re: Double updates with CMR fields
sblaes Sep 16, 2003 9:29 AM (in response to sblaes)Thanks for all the effort on this. I got the source and mucked around a bit, but haven't had time to delve into it too deeply. This would be my first time actually playing around with the JBoss source, so I'm sure there will be a significant learning curve.
-
14. Re: Double updates with CMR fields
wolfc Sep 17, 2003 3:25 AM (in response to sblaes)Again I was off the mark. There was a bug in my own code. So it looks like the problem is solved. :-)
Now to get the patch into CVS. Help!