Вылетает ошибка БД при выполнении скрипта в отчете на груви:
def tx = persistence.getTransaction()
if (tx == null) {
tx = persistence.createTransaction()
}
def entityManager = persistence.getEntityManager()
QueryImpl smrDocsQuery = entityManager.createNativeQuery("select ap.id, d.VALIDATION_MSG, d.status, d.name from enerstroymain_Accounting_Point ap " +
"left join docs_Document_Reference ddr on ddr.entity_id = ap.ID " +
"left join docs_document d on d.ID = ddr.document_id " +
"where d.template_id = 'e5040b84-60b6-3f7e-202d-61d53918d9b8' and ap.id IN (" + apArray.collect{ "'$it.id'" }.join(",") +
") order by d.create_ts")
List mkdDocsArray = smrDocsQuery.getResultList()
tx.end()
Лог :
An error occurred while loading data for band [line] and query [data1]. Report name [Выполнение СМР по объектам]
An error occurred while loading data for data set [data1]
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.3.2-cuba): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: Соединение уже было закрыто
Error Code: 0
Call: select ap.id, d.VALIDATION_MSG, d.status, d.name from enerstroymain_Accounting_Point ap left join docs_Document_Reference ddr on ddr.entity_id = ap.ID left join docs_document d on d.ID = ddr.document_id where d.template_id = 'e5040b84-60b6-3f7e-202d-61d53918d9b8' and ap.id IN () order by d.create_ts
Query: DataReadQuery(sql="select ap.id, d.VALIDATION_MSG, d.status, d.name from enerstroymain_Accounting_Point ap left join docs_Document_Reference ddr on ddr.entity_id = ap.ID left join docs_document d on d.ID = ddr.document_id where d.template_id = 'e5040b84-60b6-3f7e-202d-61d53918d9b8' and ap.id IN () order by d.create_ts")
Internal Exception: org.postgresql.util.PSQLException: Соединение уже было закрыто
Error Code: 0
Call: select ap.id, d.VALIDATION_MSG, d.status, d.name from enerstroymain_Accounting_Point ap left join docs_Document_Reference ddr on ddr.entity_id = ap.ID left join docs_document d on d.ID = ddr.document_id where d.template_id = 'e5040b84-60b6-3f7e-202d-61d53918d9b8' and ap.id IN () order by d.create_ts
Query: DataReadQuery(sql="select ap.id, d.VALIDATION_MSG, d.status, d.name from enerstroymain_Accounting_Point ap left join docs_Document_Reference ddr on ddr.entity_id = ap.ID left join docs_document d on d.ID = ddr.document_id where d.template_id = 'e5040b84-60b6-3f7e-202d-61d53918d9b8' and ap.id IN () order by d.create_ts")
Соединение уже было закрыто