The average times it takes to generate a report can be anyone from 2-10 minutes.
This function is called from 1 of 2 different places.
The first is by visiting a form and clicking on an Excel icon which calls createExcelReport() for one part number and emails the report to the user. This does not have any issues and has not ever timed out on me.
I also have another application that lets you add part numbers to a queue. There is a scheduled task that runs after hours that processes these parts one by one and calls createExcelReport() for each of these parts and emails each document to the user who requested it as it gets generated.
I found that when you add a lot of parts to the queue, Verj eventually throws a transaction timeout error because it appears that Verj counts the transaction time as the sum of the time it takes to create the report for each individual part and not the time it takes to generate the report for an individual part number.
To fix this, I added system.transactionManager.setDefaultTransactionTimeout(3600); at the top of createExcelReport() to extend the timeout period.
This seems to fix the transaction timeout error but has a very annoying side effect where there are 4 warning messages printed every second to the server logs non-stop. Even after the report has successfully run, these messages continue.
The messages are:
Code: Select all
14-Jul-2020 14:59:40.229 WARNING [WfMS Queue Processor] com.atomikos.logging.JULLogger.logWarning Attempt to create a transaction with a timeout that exceeds maximum - truncating to: 2000000
14-Jul-2020 14:59:40.483 WARNING [WfMS Queue Processor] com.atomikos.logging.JULLogger.logWarning Attempt to create a transaction with a timeout that exceeds maximum - truncating to: 2000000
14-Jul-2020 14:59:40.735 WARNING [WfMS Queue Processor] com.atomikos.logging.JULLogger.logWarning Attempt to create a transaction with a timeout that exceeds maximum - truncating to: 2000000
14-Jul-2020 14:59:40.987 WARNING [WfMS Queue Processor] com.atomikos.logging.JULLogger.logWarning Attempt to create a transaction with a timeout that exceeds maximum - truncating to: 2000000
Removing system.transactionManager.setDefaultTransactionTimeout(3600); causes these warning messages to go away but causes the transaction timeout issue to return.
I am also confused by the fact that I am setting the timeout to 3600 (60 minutes) but the message says that the timeout exceeds the maximum which is 2,000,000 which is far higher than the value that I am setting it to.