Hi,
I have a problem with my CMP entity bean with 1:N relation
Deployement is ok, but when I want use a relation method, I have the error

17:11:46,279 ERROR [STDERR] java.lang.IllegalStateException: A CMR
collection may only be used within the transction in which it was created

Does anybody know something about this problem ?

thank you !

regards

bertrand paquet

PS : here is my configuration :

orderBean.java :

public abstract Collection getMessages();
it's when I call this function that I see a problem

order.java :
  public Collection getMessages(  )  throws java.rmi.RemoteException;

ejb-jar.xml :

<ejb-relation >
         <ejb-relation-name>order-message-relation</ejb-relation-name>

         <ejb-relationship-role >

<ejb-relationship-role-name>one-order-has-many-messages</ejb-relationship-ro
le-name>
            <multiplicity>One</multiplicity>
            <relationship-role-source >
               <ejb-name>Order</ejb-name>
            </relationship-role-source>
            <cmr-field >
               <cmr-field-name>messages</cmr-field-name>
               <cmr-field-type>java.util.Collection</cmr-field-type>
            </cmr-field>
         </ejb-relationship-role>

         <ejb-relationship-role >

<ejb-relationship-role-name>one-message-belongs-to-one-order</ejb-relationsh
ip-role-name>
            <multiplicity>Many</multiplicity>
            <relationship-role-source >
               <ejb-name>Message</ejb-name>
            </relationship-role-source>
         </ejb-relationship-role>

      </ejb-relation>

jbosscmp-jdbc.xml :
 <ejb-relation>
      <ejb-relation-name>order-message-relation</ejb-relation-name>
      <foreign-key-mapping/>
      <ejb-relationship-role>

<ejb-relationship-role-name>one-order-has-many-messages</ejb-relationship-ro
le-name>
            <key-fields>
              <key-field>
               <field-name>id</field-name>
               <column-name>orderIdFK</column-name>
             </key-field>
          </key-fields>
      </ejb-relationship-role>
      <ejb-relationship-role>

<ejb-relationship-role-name>one-message-belongs-to-one-order</ejb-relationsh
ip-role-name>
          <fk-constraint>false</fk-constraint>

      </ejb-relationship-role>
    </ejb-relation>




-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to