Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1366

Alter table throws Exception when using with mysql and postgresql

    XMLWordPrintable

Details

    Description

      I tried to use the following options in CMP deployment:

      <create-table>true</create-table>
      <alter-table>true</alter-table>

      The deployment is deployed to:

      JBoss 4.0.1 + MySQL 4.x + WindowsXP

      I found that the app server generates an exception and
      the CMP Entity Beans cannot be deployed. The exception
      is caused by the SQL that trying to add a column to an
      existing column.

      Finally I figure out in the docs that the alter table
      feature compares column names in uppercases so that the
      lower case column names in default mapping cause trouble.

      I tried to dig into the source codes and figure the
      comparison is made to DB column names and uppercased
      column names. I just wonder why not compare both names
      in uppercase, but only one in uppercase and the other not?

      I already make a patch for myself which make both names
      to uppercase before comparison.

      During the investigation on this issue, I also found that
      the code may throw a null pointer exception when checking to
      add an index to a CMR-field.

      I have already make a patch.

      Attachments

        1. jdbcstartcommand.diff
          3 kB
          Jesper Pedersen
        2. JDBCStartCommand.java
          39 kB
          Richard C. L. Li
        3. jdbcstartcommand.patch
          3 kB
          Jesper Pedersen

        Issue Links

          Activity

            People

              olubyans@redhat.com Alexey Loubyansky
              richard.li_jira Richard C. L. Li (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: