You need to wrap your code up in a single transaction. You can use the UserTransaction code given at the end of the chapter, or you can put your code in a Session Bean.
The tx attributes are set in the ejb-jar.xml file. If you don't declare tx attributes, the default is Required. Tx attributes are covered in the Quick Start Guide transaction chapter. -dain Justin Casp wrote: > Hi List, > In reading the latest JBossCMP docs, I found a note in the Transactions > section of the Optimized Loading chapter that mentions the exact problem I'm > having. > quote (footnote 21) > "It's actually worse than this. JBossCMP executes each of these queries three > times; once for each cmp-field that is accessed. This is because the > preloaded values are discarded between the cmp-field accessor calls." > > However, the chapter ends without mentioning how to configure the transaction > settings for query methods and the cmp-field accessor methods in order to > avoid this. Perhaps this is outside the scope of the chapter, but I haven't > been able to find much else in this doc regarding transaction configuration. > Could someone please point me to some info that would help me resolve this > N*M +1 problem? > > right now I am not using any specific transaction settings for any of the > methods in either the entity beans or the session beans that wrap the entity > beans. I'm guessing this is where my fix will take place, but am unsure of > what to do. > > thank you for your help > Justin > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user