Hello, Using 3.2.5:
I haven an ejb with a 1:M CMR. Both ends of the relationship are of the same type. I have abstract accessor methods: public abstract RdfStatementLocal getParent(); public abstract void setParent(RdfStatementLocal parent); where RdfStatementLocal is the local bean interface. The primary key for the bean is an unknown-pk to allow for auto-increment primary keys. | ... | <cmp-field> | <field-name>parent</field-name> | | <jdbc-type>INTEGER</jdbc-type> | <sql-type>INT(11)</sql-type> | | </cmp-field> | | <unknown-pk> | <unknown-pk-class>java.lang.Integer</unknown-pk-class> | <field-name>id</field-name> | <column-name>id</column-name> | <jdbc-type>INTEGER</jdbc-type> | <sql-type>INT(11)</sql-type> | <auto-increment/> | </unknown-pk> | <entity-command name="mysql-get-generated-keys"> | </entity-command> | | <relationships> | <ejb-relation> | <ejb-relation-name>derived-from</ejb-relation-name> | | <ejb-relationship-role> | <ejb-relationship-role-name>child</ejb-relationship-role-name> | <fk-constraint>true</fk-constraint> | <key-fields/> | | </ejb-relationship-role> | <ejb-relationship-role> | <ejb-relationship-role-name>parent</ejb-relationship-role-name> | <key-fields> | <key-field> | <field-name>id</field-name> | <column-name>id</column-name> | <jdbc-type>INTEGER</jdbc-type> | <sql-type>INT(11)</sql-type> | </key-field> | </key-fields> | | </ejb-relationship-role> | </ejb-relation> | </relationships> | When I try to set one of these fields I get the following error, which looks like jboss is not using the primary key for storeage. | org.jboss.tm.JBossTransactionRolledbackLocalException: null; CausedByException is: | Unable to commit, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=wd-ukblueneil//25, BranchQual=] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Internal error setting parameters for field parent; CausedByException is: | Cannot convert class $Proxy45 to SQL type requested due to java.lang.ClassCastException - null); - nested throwable: (org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=wd-ukblueneil//25, BranchQual=] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.ejb.EJBException: Internal error setting parameters for field parent; CausedByException is: | Cannot convert class $Proxy45 to SQL type requested due to java.lang.ClassCastException - null)) | at org.jboss.ejb.plugins.TxInterceptorCMT.throwJBossException(TxInterceptorCMT.java:546) | at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:461) | at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:324) | | any help please Neil View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3853521#3853521 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3853521 ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
