I have 2 EJBs both associated with each other through CMR. One of the EJBs has built in primary key field (by using the <primkey-field>id</primkey-field> in the ejb-jar.xml) while the other relies on auto-generation of primary key. The create() method of this EJB does not take any parameter. After doing some search in the forum, I understand to support auto-generation of primary key for the 2nd EJB, I have to include the following in the default section of jbosscmp-jdbc.xml:
I also understood that for this EJB I need to a section like the one below:
I am using a firebird driver . In the standardjbosscmp-jdbc.xml, I added an element
<auto-increment-template>?1</auto-increment-template> in the type-mapping section for this driver. BTW, I am not sure if this is the correct syntax. I just cut and pasted from the another section.
The EJBs deplyed fine and created the necessary tables but when I went an EJB which required an ID, the firebird driver threw an exception:
INFO: Loading person with id = '1'
2003-10-03 10:47:47,392 ERROR [org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBC30GeneratedKeysCreateCommand.PersonBean] Could not create entity
java.sql.SQLException: not yet implemented
This was working fine till I had the section on unknownpk. Could somebody tell me if I have configured something wrong in jbosscmp-jdbc.xml.