I am using JBoss 4.0.2 and Postgres 7.2 as my database server. Now I am trying to insert a record in the DB using CMP beans meaning I have not written any SQL statements. Only abstract methods and the primarykey field is autogenerated by the DB. i.e it is of Serial type.
Now when I run the EJB only the primary key field is generated but the rest of the values are not entered in the Database.Can anyone tell me why this could happen.
<datasources> <local-tx-datasource> <jndi-name>PostgresDS</jndi-name> <connection-url>jdbcostgresql://192.168.1.33:5432/MyDB</connection-url> <driver-class>org.postgresql.Driver</driver-class> <user-name>postgres</user-name> <password></password> <!-- sql to call when connection is created <new-connection-sql>some arbitrary sql</new-connection-sql> -->
<!-- sql to call on an existing pooled connection when it is obtained from pool <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql> -->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --> <metadata> <type-mapping>PostgreSQL 7.2</type-mapping> </metadata> </local-tx-datasource>
Please can any one tell me the reason. When I debug i can see all the values which I pass from the frontend in my ejbCreate() method.