5 Replies Latest reply on Sep 11, 2002 2:35 PM by Dain Sundstrom

    Read only ejbs exception

    Marcin Jarzab Newbie

      Hi.

      I'm trying to play a liitle bit with read only entities based on CMP2.0 engine and it seems to me that setting read only flag for whole entity in jbosscmp-jdbc.xml

      I have marked tjem as read only in jbosscmp-jdbc.xml,
      set commit D option in jboss,xml for CMP2.0 container,
      "Supports" transaction attribute for session ejb(fascade) and "Supports" for entities which
      ensures that this ejbs will be invoked in non-transactional state.

      During second hit to this entity I'm getting following exception:

      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.dsrg.ejb.laboratorycmp2_0.LaboratorySLBean.calculateGroupScoreEstimation(Unknown Source)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)


      .......

      any ideas?