1 Reply Latest reply on Aug 9, 2005 5:42 AM by thomas Broussaud

    Using insert-after-ejb-post-create breaks mssql-fetch-key

    czednick Newbie

      Using insert-after-ejb-post-create breaks mssql-fetch-key (at least for my setup).

      When using the entity create command: mssql-fetch-key with insert-after-ejb-post-create set to true I get

      javax.ejb.CreateException: Primary key for created instance is null.
      , exceptions. However when post-create is set to false everything works nicely, except that I have to set my CMR foreign key fields using mapped CMP fields instead of CMR on ejbPostCreate.

      Is this a known issue with using insert-after-ejb-post-create and mssql-fetch-key together? I couldn't find any other posting in the forms, wiki, docs or by doing a Google search about this problem.

      Info: I'm using JBoss 4.0 SP1, MSSQLServer 2000 and CMP 2.1. The EJB I'm having the issue with has a one to many relationship with another EJB. The table requires the foreign key to be populated on insert, hence the reason I'm trying to use ejb-post-create.

      Any ideas? Is it a bug? For now I will use the work around, just wanted to post this to save other possible trouble.

      Thanks,
      Casey