use*_*147 6 postgresql grails cloud-foundry
我有一个grails应用程序成功运行在cloudfoundry中,H2作为数据库.我现在想切换到postgresql.当我在本地针对postgreSQL运行应用程序时,一切都按预期工作.
在cloudfoundry实例上,我在一个相当长时间运行的分析中得到一个异常,我作为后台任务执行(使用grails executor插件).在这个异步任务中
def future = executorService.submit({
    return analysisService.analyzeProject(model, project)
})
我从数据库中获得以下异常:
2012-11-26 10:27:38,319 [pool-2-thread-1] ERROR interceptor.TransactionInterceptor  - Application exception overridden by rollback exception
org.springframework.dao.DataAccessResourceFailureException: Hibernate operation: could not execute query; SQL [select this_.id as id8_0_, this_.version as version8_0_, this_.language as language8_0_, this_.url as url8_0_ from sonar_adapter_configuration this_]; FATAL: terminating connection due to administrator command; nested exception is org.postgresql.util.PSQLException: FATAL: terminating connection due to administrator command
    at myapp.adapters.sonar.SonarAdapterService.loadSonarConfig(SonarAdapterService.groovy:184)
    at myapp.adapters.sonar.SonarAdapterService.determineArtefactSizes(SonarAdapterService.groovy:145)
    at myapp.project.AnalysisService.analyzeProject(AnalysisService.groovy:46)
    at myapp.project.ProjectController$_analyzeProject_closure2.doCall(ProjectController.groovy:69)
    at grails.plugin.executor.PersistenceContextRunnableWrapper$_run_closure1.doCall(PersistenceContextRunnableWrapper.groovy:34)
    at grails.plugin.executor.PersistenceContextWrapper.wrap(PersistenceContextWrapper.groovy:35)
    at grails.plugin.executor.PersistenceContextRunnableWrapper.run(PersistenceContextRunnableWrapper.groovy:34)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.postgresql.util.PSQLException: FATAL: terminating connection due to administrator command
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
    at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
    ... 13 more
可能导致这种情况的任何想法?
您很可能会遇到长时间运行连接的配置超时(如果我没有弄错的话,这是无法更改的,因为它是为了保护服务器免受会消耗所有 cpu/io 的格式不正确的查询的影响)
您可能想要尝试的是将长时间运行的查询分割成较小的查询并总结结果(如果是选择)
| 归档时间: | 
 | 
| 查看次数: | 6047 次 | 
| 最近记录: |