3 Replies Latest reply on Sep 9, 2002 4:59 PM by Dain Sundstrom

    databse generated pk

    Sebastien Petrucci Newbie

      Hi,

      I'm a newbie wrt to jboss, I just moved from Orion.

      I'm currently developping an application for a big company, using J2EE, Struts and SQL Server 2000.

      Altough I try to avoid them as much as I can, I'm using some database generated pk (identity counters for mssql). JBoss does not (as far I know) support that feature. I just discovered that Borland Application Server v5.02 provides support for it.

      For a CMP bean, you can define those properties :
      • getPrimaryKeyBeforeInsertSql
      • getPrimaryKeyAfterInsertSql
      • ignoreOnInsert
      • useGetGeneratedKeys

      With that, the container knows it should include the pk in the insert statement, and/or if it should execute a statement before or after the insert to retrieve the key.
      They also provide some configuration example for Oracle and MS-SQL Server.

      I think that this functionnality is just *great* and I would love to see it included in JBossCMP.
      Off course, there are other solution, like using an external counter. I think however that using the database mechanisms for that is just cleaner, simpler, and faster... especially when you have to integrate with other application already using that.

      I would be please to do it myself, but as I told you, I'm a newbie using jboss. Despite that, I would be really please if I could give any help...

      I also take the opportunity to congratulate everybody for this nice product !

      Regars,
      Sebastien.