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

      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.

              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

                Created:
                Updated:
                Resolved: