Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-3626

Check for table presence fails when a schema table prefix is used

      See https://jira.codehaus.org/browse/ACT-1940

      If on all supported databases, a schema prefix is identified by a dot, a nicer fix would be to look for a dot in the databaseTablePrefix property.

        This is the controller panel for Smart Panels app

            [CAM-3626] Check for table presence fails when a schema table prefix is used

            Hi,

            Where did you find the property "tablePrefixIsSchema" and for what is it used/should it be used?

            Cheers,
            Thorben

            Thorben Lindhauer added a comment - Hi, Where did you find the property "tablePrefixIsSchema" and for what is it used/should it be used? Cheers, Thorben

            Dimitri Lubenski added a comment - Please check https://jira.codehaus.org/browse/ACT-1940 It is available in the: http://activiti.org/javadocs/org/activiti/engine/ProcessEngineConfiguration.html Cheers, Dimitri

            Ok, I updated the bug description accordingly.

            Thanks for reporting.

            Thorben Lindhauer added a comment - Ok, I updated the bug description accordingly. Thanks for reporting.

            Dimitri Lubenski added a comment - - edited

            Thanks a lot.

            Please keep in mind, that currently the workaround <property name="databaseSchemaUpdate" value="none" /> has to be used in order to assure, that the engine can start. This is a workaround and is not documented.

            The situation occurs in cases where oracle is used, and you access the DB from the web application using e.g. APP_USER while the tables are created in the ADMIN_USER. This is usually done to implement security reducing the permissions for the APP_USER to the minimum.

            Having
            <property name="databaseSchema" value="ADMIN_USER" />
            <property name="databaseTablePrefix" value="ADMIN_USER." />
            <property name="databaseSchemaUpdate" value="false" />

            does not solve the issue, because the version check is performed during the engine startup (spring initialization) and the table with the version cannot be found.

            This post can also be helpful http://forums.activiti.org/content/tables-missing-components-engine-history-identity

            Dimitri Lubenski added a comment - - edited Thanks a lot. Please keep in mind, that currently the workaround <property name="databaseSchemaUpdate" value="none" /> has to be used in order to assure, that the engine can start. This is a workaround and is not documented. The situation occurs in cases where oracle is used, and you access the DB from the web application using e.g. APP_USER while the tables are created in the ADMIN_USER. This is usually done to implement security reducing the permissions for the APP_USER to the minimum. Having <property name="databaseSchema" value="ADMIN_USER" /> <property name="databaseTablePrefix" value="ADMIN_USER." /> <property name="databaseSchemaUpdate" value="false" /> does not solve the issue, because the version check is performed during the engine startup (spring initialization) and the table with the version cannot be found. This post can also be helpful http://forums.activiti.org/content/tables-missing-components-engine-history-identity

            Thorben Lindhauer added a comment - - edited

            Hi Bernd,

            The fix was to separate cases when determining the actual name of the table to be checked for presence.

            Cases:
            1)

            • databaseSchema: MY_SCHEMA
            • databaseTablePrefix: null
            • => plain table name is used

            2)

            • databaseSchema: MY_SCHEMA
            • databaseTablePrefix: MY_PREFIX_
            • => MY_PREFIX_ + plain table name is used

            3)

            • databaseSchema: MY_SCHEMA
            • databaseTablePrefix: MY_SCHEMA.
            • => plain table name is used

            4)

            • databaseSchema: MY_SCHEMA
            • databaseTablePrefix: MY_SCHEMA.MY_PREFIX_
            • => MY_PREFIX_ + plain table name is used

            The fix assumes that in the databaseTablePrefix property, a schema is separated from the rest of the prefix by a dot.

            Cheers,
            Thorben

            Thorben Lindhauer added a comment - - edited Hi Bernd, The fix was to separate cases when determining the actual name of the table to be checked for presence. Cases: 1) databaseSchema: MY_SCHEMA databaseTablePrefix: null => plain table name is used 2) databaseSchema: MY_SCHEMA databaseTablePrefix: MY_PREFIX_ => MY_PREFIX_ + plain table name is used 3) databaseSchema: MY_SCHEMA databaseTablePrefix: MY_SCHEMA. => plain table name is used 4) databaseSchema: MY_SCHEMA databaseTablePrefix: MY_SCHEMA.MY_PREFIX_ => MY_PREFIX_ + plain table name is used The fix assumes that in the databaseTablePrefix property, a schema is separated from the rest of the prefix by a dot. Cheers, Thorben

              thorben.lindhauer Thorben Lindhauer
              Dimitri Dimitri Lubenski
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: