Open issues

When we remove a @Unique constraint, Active Objects is not able to drop the constraint
AO-3489
Bitbucket branch created via Jira but no commits appear
AO-3494
Removing non-null constraint in a column with a pre-existing default value breaks MSSQL upgrade task
AO-3493
Universal Importer
AO-3492
After schema changes ActiveObjects yields exception "cached plan must not change result type" with PostgreSQL - JDBC driver 9.4
AO-697
Open AO database importer packages to other plugins
AO-689
Distinct query on an entity having an unlimited length text field results in exception on MS SQL Server
AO-687
TenantAwareActiveObjects blocks Jira during startup
AO-678
AcitveObjects generated queries with large IN clauses that result in SQL Server errors
AO-652
OneToMany relations are not being updated on same transaction
AO-598
Date fields are incorrectly preloaded on Oracle
AO-579
net.java.ao.db.SQLServerDatabaseProvider#setQueryResultSetProperties is not converting from zero-based to one-based
AO-385
ActiveObjects removes and refetches Enum values from the database
AO-382
AO generates invalid SQL when GROUP BY query selects an aggregate column
AO-3490
MS SQL database for JIRA set to *SQL_Latin1_General_CP437_CI_AI' but fails Collation test - why?
AO-3478
Return long for ao.count method
AO-3477
ActiveObjects fails to detect existing tables or create tables with MySQL JDBC Connector 8.0.11
AO-3462
Where clause column names on right hand side of conditional operator are not quoted for postgres
AO-3458
Two tests fail when run in a transaction
AO-3456
AO: Standard Case Insensitive Order
AO-3446
MySQL is blocking a thread and hanging the UPM installation
AO-3442
Support for specifying ASC/DESC for each element in a multicolumn index
AO-3431
Table name is not being quoted in "join/on" and "where"
AO-3428
NullPointerException on ao.create operation
AO-3413
Problems with deleting a table
AO-3411
Parameters order is not predictable leading to ORA-24816 when inserting a row into a table with Unlimited string column and another (limited) string column
AO-3395
Add coverage for Microsoft JDBC Driver 6.0.7507
AO-3387
Default ANSI quotes for MySQL table names
AO-3370
Active Objects runs out of connections when migrating enough times
AO-711
AO.create() fails on SQL Server when default schema is not configured and when generated primary key is overridden
AO-710
More JDBC driver tests
AO-707
SonarQube - Analyse and fix all Critical issues
AO-702
Deprecate ActiveObjects stream methods
AO-694
plugins/servlet/active-objects/tables/list broken in Bamboo
AO-690
Provide AO table prefix for plugins
AO-642
Creating a table with any index and @Unique fails on Oracle with ORA-01408
AO-436
Distinct does not work with count for a field
AO-398
Fail during migrating CLOB type column with missing index in Oracle DB
AO-3465
Foreign key columns are not being preloaded by default
AO-3454
AO DatabaseUpdater causes failures on oracle
AO-3392
AO race condition leads to AO deadlock on DB migration
AO-3388
Fix Javadocs For JDK 8 Linting
AO-700
issue 1 of 42

When we remove a @Unique constraint, Active Objects is not able to drop the constraint

Description

We removed @Unique constraints from some of our tables and some Exceptions were thrown in the log file.

We have several MSSQL cases with the following log.

1 2019-05-22 14:27:48,555 active-objects-init-JiraTenantImpl{id='system'}-0 ERROR anonymous [n.java.ao.sql] Exception executing SQL update <ALTER TABLE jiraschema.AO_3C6513_XPORTER_TEMPLATE ALTER COLUMN FILENAME NVARCHAR(255) NOT NULL>2019-05-22 14:27:48,555 active-objects-init-JiraTenantImpl{id='system'}-0 ERROR anonymous [n.java.ao.sql] Exception executing SQL update <ALTER TABLE jiraschema.AO_3C6513_XPORTER_TEMPLATE ALTER COLUMN FILENAME NVARCHAR(255) NOT NULL>com.microsoft.sqlserver.jdbc.SQLServerException: The object 'U_AO_3C6513_XPORTER980075700' is dependent on column 'FILENAME'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:258) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1535) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:845) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:752) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7151) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2478) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:219) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:199) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeUpdate(SQLServerStatement.java:680) at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:234) at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:234) at net.java.ao.DatabaseProvider.executeUpdate(DatabaseProvider.java:2245) at net.java.ao.DatabaseProvider.executeUpdateForAction(DatabaseProvider.java:2301) at net.java.ao.DatabaseProvider.executeUpdatesForActions(DatabaseProvider.java:2273) at net.java.ao.schema.SchemaGenerator.migrate(SchemaGenerator.java:91) at net.java.ao.EntityManager.migrate(EntityManager.java:128) at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:51) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory$1.doInTransaction(AbstractActiveObjectsFactory.java:77) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory$1.doInTransaction(AbstractActiveObjectsFactory.java:72) at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21) at com.atlassian.jira.DefaultHostContextAccessor.doInTransaction(DefaultHostContextAccessor.java:50) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) at com.sun.proxy.$Proxy465.doInTransaction(Unknown Source) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:131) at com.sun.proxy.$Proxy465.doInTransaction(Unknown Source) at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:18) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy1035.execute(Unknown Source) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory.create(AbstractActiveObjectsFactory.java:72) at com.atlassian.activeobjects.internal.DelegatingActiveObjectsFactory.create(DelegatingActiveObjectsFactory.java:32) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects$1$1$1.call(TenantAwareActiveObjects.java:102) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects$1$1$1.call(TenantAwareActiveObjects.java:97) at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:38) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)2019-05-22 14:27:48,571 active-objects-init-JiraTenantImpl{id='system'}-0 WARN anonymous [n.j.ao.db.MsJdbcSQLServerDatabaseProvider] Error in schema creation: The object 'U_AO_3C6513_XPORTER980075700' is dependent on column 'FILENAME'.; attempting to roll back last partially generated table2019-05-22 14:27:48,571 active-objects-init-JiraTenantImpl{id='system'}-0 WARN anonymous [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.xpandit.plugins.jiraxporter] failed to create ActiveObjectscom.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:Database: - name:Microsoft SQL Server - version:11.00.2100 - minor version:0 - major version:11Driver: - name:Microsoft JDBC Driver 6.2 for SQL Server - version:6.2.1.0

 

and one Oracle SQL scenario with the error:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 2019-06-27 14:36:53,848 active-objects-init-JiraTenantImpl{id='system'}-0 WARN anonymous [n.j.ao.db.OracleDatabaseProvider] Error in schema creation: ORA-02443: Cannot drop constraint - nonexistent constraint ; attempting to roll back last partially generated table 2019-06-27 14:36:53,990 active-objects-init-JiraTenantImpl{id='system'}-0 WARN anonymous [c.a.activeobjects.osgi.TenantAwareActiveObjects] bundle [com.xpandit.plugins.jiraxporter] failed to create ActiveObjects com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library: Database: - name:Oracle - version:Oracle Database 11g Release 11.2.0.3.0 - 64bit Production - minor version:2 - major version:11 Driver: - name:Oracle JDBC driver - version:12.2.0.1.0 java.sql.SQLException: ORA-02443: Cannot drop constraint - nonexistent constraint at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:53) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory$1.doInTransaction(AbstractActiveObjectsFactory.java:77) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory$1.doInTransaction(AbstractActiveObjectsFactory.java:72) at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21) at com.atlassian.jira.DefaultHostContextAccessor.doInTransaction(DefaultHostContextAccessor.java:50) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) at com.sun.proxy.$Proxy336.doInTransaction(Unknown Source) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:131) at com.sun.proxy.$Proxy336.doInTransaction(Unknown Source) at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:18) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy1031.execute(Unknown Source) at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory.create(AbstractActiveObjectsFactory.java:72) at com.atlassian.activeobjects.internal.DelegatingActiveObjectsFactory.create(DelegatingActiveObjectsFactory.java:32) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects$1$1$1.call(TenantAwareActiveObjects.java:102) at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects$1$1$1.call(TenantAwareActiveObjects.java:97) at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:38) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.sql.SQLException: ORA-02443: Cannot drop constraint - nonexistent constraint at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494) at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:213) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:37) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:896) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1119) at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1661) at oracle.jdbc.driver.OracleStatement.executeLargeUpdate(OracleStatement.java:1626) at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1613) at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:282) at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:234) at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:234) at net.java.ao.DatabaseProvider.executeUpdate(DatabaseProvider.java:2245) at net.java.ao.DatabaseProvider.executeUpdateForAction(DatabaseProvider.java:2301) at net.java.ao.DatabaseProvider.executeUpdatesForActions(DatabaseProvider.java:2273) at net.java.ao.schema.SchemaGenerator.migrate(SchemaGenerator.java:91) at net.java.ao.EntityManager.migrate(EntityManager.java:128) at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:51) ... 44 more Caused by: Error : 2443, Position : 57, Sql = ALTER TABLE "AO_3C6513_XPORTER_TEMPLATE" DROP CONSTRAINT U_AO_3C6513_XPORTER1963927984, OriginalSql = ALTER TABLE "AO_3C6513_XPORTER_TEMPLATE" DROP CONSTRAINT U_AO_3C6513_XPORTER1963927984, Error Msg = ORA-02443: Cannot drop constraint - nonexistent constraint at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498) ... 65 more

 

The only change in our plugin was removing the @Unique annotation.
Our plugin active objects dependency:

1 2 3 4 5 6 <dependency> <groupId>com.atlassian.activeobjects</groupId> <artifactId>activeobjects-plugin</artifactId> <version>1.0.0</version> <scope>provided</scope> </dependency>

What can we do fix this issue?

Environment

None

Testing Notes

Add notes...

Status

Assignee

Unassigned

Reporter

Hugo Freixo

Labels

None

Add-on Type

Server

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Components

Priority

Blocker