2 Replies Latest reply on Oct 1, 2002 3:00 PM by Alexey Loubyansky

    autonumber table problem, it kept removed when server shut d

    liu qiang Newbie

      Hi! I have a problem using autonumber table. I found everytime I shutdown the Jboss server, the autonumber table is removed, But I want it NOT removed.
      In my jbosscmp-jdbc.xml file, I set <remove-table> as false, and I found all the tables I created was kept unremoved when I shut down the server(This is what I want), except the autonumber table. I also use the jaws.xml, and set the following in jaws.xml, but it doesnot help at all. The autonumber table still got removed when I shut down the server. Does anyone know
      the solution of this?

      My jaws.xml:

      <type-mapping>MS SQLSERVER2000</type-mapping>




      My jbosscmp-jdbc.xml part is as follows:


      <datasource-mapping>MS SQLSERVER2000</datasource-mapping>





        • 2. Re: autonumber table problem, it kept removed when server sh
          Alexey Loubyansky Master

          If you are with JBoss-3.X then drop jaws.xml.
          What are trying to achieve?
          What field is the primary key?
          Is the field that is the primary key is a cmp field also?

          You are going the wrong way. It won't work in this way. You should consider unknown primary key setup. Currently, for MSSQL you can use such constructs:

          <!-- using sequence table -->
          <entity-command name="pk-sql">
          SELECT SEQ_2279_1.nextval FROM DUAL


          <!-- using UUIDKeyGenerator -->
          <entity-command name="key-generator"

          This will work only with Branch_3_2 and HEAD.

          Auto-increment is currently supported only for MySQL. You can help us to add support for MSSQL autonumber by providing 'CREATE TABLE' SQL statement that sets up a table with autonumber'ed field.

          But I agree it's strange that the table is removed. I use MySQL and don't see it.