The problem we are having is a strange one, on Every table Exept this one and one 
other we require an auto-increment PK, 

With this one we are passing in the value we require for the primary key, but we are 
getting the error 

        at java.lang.Thread.run(Thread.java:536)
12:21:18,933 ERROR [LogInterceptor] TransactionRolledbackException in method: pu
blic abstract java.lang.Long com.ingotz.points.core.usecase.Test.testCard() thro
ws java.rmi.RemoteException, causedBy:
javax.ejb.EJBException: getGeneratedKeys returned an empty ResultSet
        at org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCMySQLCreateCommand.executeI
nsert(JDBCMySQLCreateCommand.java:77)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInser
t(JDBCAbstractCreateCommand.java:287)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBC
AbstractCreateCommand.java:138)


from what we can see we are doing nothing out of the ordinary....

The ejbCreate() function is as follows

  public Long ejbCreate(Long id,int pin) throws CreateException
  {
        setId(id);
        setPin(pin);
    return null;
  }

The ejb-jar is as follows

        <ejb-name>CardBean</ejb-name>
        com.ingotz.points.core.entity.CardHome
        com.ingotz.points.core.entity.Card
        <local-home>com.ingotz.points.core.entity.CardLocalHome</local-home>
        com.ingotz.points.core.entity.CardLocal
        <ejb-class>com.ingotz.points.core.entity.CardBean</ejb-class>
        <persistence-type>Container</persistence-type>
        <prim-key-class>java.lang.Long</prim-key-class>
        False
        <cmp-field><field-name>id</field-name></cmp-field>
        <cmp-field><field-name>pIN</field-name></cmp-field>
        <cmp-field><field-name>password</field-name></cmp-field>
        <cmp-field><field-name>state</field-name></cmp-field>
        <cmp-field><field-name>expiryDate</field-name></cmp-field>
        <cmp-field><field-name>changeAuth</field-name></cmp-field>
        <cmp-field><field-name>deadReason</field-name></cmp-field>
        <cmp-field><field-name>lastLoginDate</field-name></cmp-field>
        <cmp-field><field-name>loginFailures</field-name></cmp-field>
        <cmp-field><field-name>timestamp</field-name></cmp-field>
        <primkey-field>id</primkey-field>
        <cmp-version>2.x</cmp-version> 
        <abstract-schema-name>CardBeanAPS</abstract-schema-name>
        <resource-ref>
                <res-ref-name>jdbc/mysql</res-ref-name>
                <res-type>javax.sql.DataSource</res-type>
                <res-auth>Container</res-auth>
        </resource-ref>
    

The jdbc-cmp xml is as follows

   
      <ejb-name>CardBean</ejb-name>
      <table-name>card</table-name>
      <cmp-field>
        <field-name>id</field-name>
        <column-name>cd_id</column-name>
        <not-null/>
      </cmp-field>
      <cmp-field>
        <field-name>pIN</field-name>
        <column-name>cd_pin</column-name>
      </cmp-field>
      <cmp-field>
        <field-name>password</field-name>
        <column-name>cd_password</column-name>
      </cmp-field>
      <cmp-field>
        <field-name>state</field-name>
        <column-name>cd_state</column-name>
      </cmp-field>
      <cmp-field>
        <field-name>expiryDate</field-name>
        <column-name>cd_expire</column-name>
      </cmp-field>
      <cmp-field>
        <field-name>changeAuth</field-name>
        <column-name>cd_changeauth</column-name>
      </cmp-field>
      <cmp-field>
        <field-name>deadReason</field-name>
        <column-name>cd_dead_reason</column-name>
      </cmp-field>
      <cmp-field>
        <field-name>lastLoginDate</field-name>
        <column-name>cd_last_log_att</column-name>
      </cmp-field>
      <cmp-field>
        <field-name>loginFailures</field-name>
        <column-name>cd_failed_logins</column-name>
      </cmp-field>
      <cmp-field>
        <field-name>timestamp</field-name>
        <column-name>cd_timestamp</column-name>
      </cmp-field>
    


What are we doing wrong?

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3832094#3832094

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3832094


-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to