After schema changes ActiveObjects yields exception "cached plan must not change result type" with PostgreSQL - JDBC driver 9.4

Description

Hi,

From time to time customers report the following stack trace when they install an upgrade of my plug-in with PostgreSQL:

1 2 3 4 5 6 7 8 9 10 11 org.postgresql.util.PSQLException: ERROR: cached plan must not change result type at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:185) ~[na:na] at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.find(TenantAwareActiveObjects.java:335) ~[na:na] at com.mycompany.myplugin.RepoConfigDaoImpl.find(RepoConfigDaoImpl.scala:19) ~[na:na] at com.atlassian.activeobjects.tx.TransactionalProxy.invoke(TransactionalProxy.java:79) ~[na:na] at com.atlassian.activeobjects.tx.TransactionalProxy.access$000(TransactionalProxy.java:18) ~[na:na] at com.atlassian.activeobjects.tx.TransactionalProxy$1.doInTransaction(TransactionalProxy.java:63) ~[na:na] at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25) ~[sal-core-2.13.4.jar:na] at com.atlassian.stash.internal.sal.spi.HostContextAccessorImpl.doInTransaction(HostContextAccessorImpl.java:27) ~[stash-platform-3.10.2.jar:na] at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:21) ~[sal-core-2.13.4.jar:na] at com.atlassian.activeobjects.internal.SalTransactionManager.inTransaction(SalTransactionManager.java:48) ~[na:na]

This one happened with the following PostgreSQL version:

  • nameostgreSQL

  • version:9.3.4

  • minor version:3

  • major version:9

  • Driver:

  • nameostgreSQL Native Driver

  • versionostgreSQL 9.4 JDBC4.1 (build 1201)

This normally happens when I add a new column to an entity. In the web I've seen similar issues and normally a restart of the application helps. PostgreSQL seams to have issues with cached plans that have been altered through table changes.

The question is: can you clear those caches in ActiveObjects to circumvent such a restart?

Thanks,
Michael

Environment

None

Testing Notes

Add notes...

Status

Assignee

Unassigned

Reporter

Mibex Software

Labels

None

Add-on Type

Server

Team

None

CC

None

Risk factor

None

QA Kickoff Status

None

QA Demo Status

None

Story Points

2

Components

Sprint

None

Affects versions

1.0.1

Priority

Critical
Configure