-
1. Re: Preload data contains multiple values, but this cmr fiel
dsundstrom Jul 24, 2002 1:48 AM (in response to leila)This is JBoss preloading additional rows of data. It is the on-load read-ahead strategy. This is discussed in the JBossCMP documentation.
-
2. Re: Preload data contains multiple values, but this cmr fiel
leila Jul 24, 2002 12:09 PM (in response to leila)I'm still confused. It makes sense for the read-ahead strategy to be used when the data is initially read before it is selected. But why is it reading ahead in the ejbPostCreate where it is setting the cmr fields for the ProjectPhase? Shouldn't it just be using the id values that were passed in?
public void ejbPostCreate(
String updateUser,
ProjectLocal project,
PhaseLocal phase,
StatusLocal status) throws CreateException
{
setProject(project);
setStatus(status);
setPhase(phase);
}
The only difference I could see was that Status and Phase are defined as read-only, while the Project is updatable. BTW, I forgot to mention that I'm running this on 3.0.1RC1.
Ss far, I haven't had any luck trying to get Xdoclet to merge read-ahead tags anywhere in the jbosscmp-jdbc.xml file. -
3. Re: Preload data contains multiple values, but this cmr fiel
leila Jul 24, 2002 5:18 PM (in response to leila)After revving up the Trace debug and seeing the sql that was being generated, I found the problem. I needed to specify @ejb-relation target-multiple="yes". Now I don't understand why the Project cmr field was working, but I changed it to be the same and it still works, so I'm happy %^)
-
4. Re: Preload data contains multiple values, but this cmr fiel
dsnyckers Aug 5, 2002 8:47 AM (in response to leila)I have a similar problem when I do the following :
I need to update the language of an article (they are related via a cmr field on article, unidirectional 1 on 1).
I have as parameters the article id and the id of the new language.
First I retrieve the article (findByPrimaryKey).
Next, I retrieve the language in the same way.
When I try to set the new langauge (article.setLanuage(newLanguage)), it gives me also the 'preload data contains multiple values, but this cmr field is single valued'.
In the trace debug, I noticed that the error happens in the remove relation method. Further inspection showed me that when I try to set the language, it retrieves ALL articles which are also related to that language. And can't find a reason why this should happen.
Does anyone have an explanation for this behaviour?
TIA -
5. Re: Preload data contains multiple values, but this cmr fiel
dsnyckers Aug 5, 2002 9:10 AM (in response to leila)I was wondering if I could solve the problem by not using the findByPrimaryKey for the article. But instead using a select method?
Could this solve my problem?
Dave -
6. Re: Preload data contains multiple values, but this cmr fiel
dsnyckers Aug 5, 2002 9:57 AM (in response to leila)I have attached my server loggings as wel as the code that I execute ...
-
7. Re: Preload data contains multiple values, but this cmr fiel
swankjesse Mar 24, 2003 6:05 PM (in response to leila)Does this solve your problem?
http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/