Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-6826

PostgresqlJDBCAdapter with table prefix errors when executing createSchemaStatements for creating Indexes.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Broker
    • Labels:
      None
    • Environment:

      ALL

      Description

      • When using PostgresqlJDBCAdapter to auto create the tables and a table prefix statement is also used the create schema statements fail because PostgresqlJDBCAdapter doesn't add the table prefix to Index:
        activemq.xml snippet:
                <bean id="postgresPersistenceAdapter" class="org.apache.activemq.store.jdbc.adapter.PostgresqlJDBCAdapter" />
        	
        		<persistenceAdapter>
                    <jdbcPersistenceAdapter createTablesOnStartup="true" adapter="#postgresPersistenceAdapter" dataSource="#postgres-ds" lockKeepAlivePeriod="5000" >
                        <statements>
                            <statements tablePrefix="LOCAL_" />
                        </statements>
                        <locker>
                            <lease-database-locker lockAcquireSleepInterval="10000" />
                        </locker>
                    </jdbcPersistenceAdapter>
                </persistenceAdapter>
        
      • amq log error
        2017-09-28 10:06:40,199 | WARN  | AMQ-1-thread-1   | DefaultJDBCAdapter               | .jdbc.adapter.DefaultJDBCAdapter  117 | 137 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-621169 | Could not create JDBC tables; they could already exist. Failure was: ALTER TABLE LOCAL_ACTIVEMQ_ACKS DROP CONSTRAINT "activemq_acks_pkey" Message: ERROR: constraint "activemq_acks_pkey" of relation "local_activemq_acks" does not exist SQLState: 42704 Vendor code: 0
        2017-09-28 10:06:40,200 | WARN  | AMQ-1-thread-1   | JDBCPersistenceAdapter           | tore.jdbc.JDBCPersistenceAdapter  601 | 137 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-621169 | Failure details: ERROR: constraint "activemq_acks_pkey" of relation "local_activemq_acks" does not exist
        org.postgresql.util.PSQLException: ERROR: constraint "activemq_acks_pkey" of relation "local_activemq_acks" does not exist
                at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)[172:org.postgresql.jdbc42:42.1.4]
                at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190)[172:org.postgresql.jdbc42:42.1.4]
                at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)[172:org.postgresql.jdbc42:42.1.4]
                at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)[172:org.postgresql.jdbc42:42.1.4]
                at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)[172:org.postgresql.jdbc42:42.1.4]
                at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)[172:org.postgresql.jdbc42:42.1.4]
        

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                chandrashekhar chandra shekhar pandey
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: