I'm getting this CMR error when I load test our system:

java.lang.IllegalStateException: The iterator of a CMR collection may only be used within the transction in which it was created
at org.jboss.ejb.plugins.cmp.jdbc.bridge.RelationSet$1.verifyIteratorIsValid(RelationSet.java:309)
at org.jboss.ejb.plugins.cmp.jdbc.bridge.RelationSet$1.hasNext(RelationSet.java:269)
at com.ingenta.acs.core.ejb.IdentityBean.getPropertyMap(IdentityBean.java:286)


Using both JBoss 3.0.3 and 3.2.0RC3 on Solaris with Sun's JDK 1.3.1 or 1.4.1.

We have an Identity entity and an IdentityProperty entity with a 1-M CMR relationship. For convenince there's a method on the Identity bean that gets the related IdentityProperties, iterates through the CMR collection and puts the values in a Map:

   public Map getPropertyMap()
   {
      Map result = new HashMap();
      Set properties = getIdentityProperties();
      for (Iterator i = properties.iterator(); i.hasNext(); )
      {
         IdentityPropertyLocal p = (IdentityPropertyLocal) i.next();
         result.put(p.getName(), p.getValue());
      }

      return result;
   }

This method is marked as transaction "Required" - the bean is marked "Supports" and the set* methods are marked "Mandatory".

In jboss.xml all get* methods have been declared read-only:

<entity>
<ejb-name>Identity</ejb-name>
<local-jndi-name>acs/core/Identity</local-jndi-name>
<method-attributes>
<method>
<method-name>get*</method-name>
<read-only>true</read-only>
</method>
</method-attributes>
</entity>

When a single person is using the application this error never occurs, but when I start load testing this error keeps occurring with relatively low load. We could never use it in production with this number of errors.

This bean is queried every time a new user is authenticated, so it's a potential bottleneck - which is why it's been marked read-only for get*. Without being marked read-only everything gets very slow (starts to take about 20 seconds to authenticate a user and show our home page) and all the jbossweb threads (max 100) get used up.

When I originally tested (with JBoss 3.0.1 I think) a while ago this error was very rare, but with 3.0.3 and 3.2.0RC3 it's a lot more common (admittedly there have been application code changes since then).

Please help!

Thanks,

Andrew



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to