Hi, After some time passed on the JBoss forum, I found an article explaining some process to manage "automatic primary key generation" (http://www.theserverside.com/resources/review/ejbpatterns-primarykeystrateg ies-sept3.zip).
In appendix A.1, there is some code using a sequencer. I found that the ejb desciptor is written for CMP version 2.x, is it possible to use these EJBs for CMP version 1.0? :D Second question: Where can I found a description of the differences between JBoss 2.4.4 and JBoss 3.0? :) here is the code: ---8<----------------------------------------------------------- <?xml version="1.0"?> <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'> <ejb-jar> <enterprise-beans> <entity> <ejb-name>Sequence</ejb-name> <local-home>examples.sequencegenerator.SequenceLocalHome</local-home> <local>examples.sequencegenerator.Sequence</local> <ejb-class>examples.sequencegenerator.SequenceBean</ejb-class> <persistence-type>Container</persistence-type> <prim-key-class>java.lang.String</prim-key-class> <reentrant>False</reentrant> <cmp-version>2.x</cmp-version> <abstract-schema-name>SequenceBean</abstract-schema-name> <cmp-field> <field-name>index</field-name> </cmp-field> <cmp-field> <field-name>name</field-name> </cmp-field> <primkey-field>name</primkey-field> <env-entry> <env-entry-name>datasourceName</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>bookPool</env-entry-value> </env-entry> <resource-ref> <res-ref-name>jdbc/bookPool</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </entity> <session> <ejb-name>SequenceSession</ejb-name> <home>examples.sequencegenerator.SequenceSessionHome</home> <remote>examples.sequencegenerator.SequenceSession</remote> <local-home>examples.sequencegenerator.SequenceSessionLocalHome</local-home> <local>examples.sequencegenerator.SequenceSessionLocal</local> <ejb-class>examples.sequencegenerator.SequenceSessionBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <env-entry> <description /> <env-entry-name>retryCount</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>5</env-entry-value> </env-entry> <env-entry> <description /> <env-entry-name>blockSize</env-entry-name> <env-entry-type>java.lang.Integer</env-entry-type> <env-entry-value>10</env-entry-value> </env-entry> </session> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>Sequence</ejb-name> <method-name>getValueAfterIncrementingBy</method-name> </method> <trans-attribute>RequiresNew</trans-attribute> </container-transaction> <container-transaction> <method> <ejb-name>SequenceSession</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> ---8<----------------------------------------------------------- Best regards, Lo�c Lef�vre _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
