[
https://issues.apache.org/jira/browse/FINERACT-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530768#comment-17530768
]
Kigenyi Wilfred edited comment on FINERACT-1592 at 5/2/22 2:53 PM:
-------------------------------------------------------------------
[~aleks] I have not interacted with Pentaho Reports long enough but I will try
to explain what I understand from what I have seen so far. Where I am not
accurate I think [~francisguchie] will chip in.
Designing a PENTAHO report involves doing the layout, specifying the queries
and also writing scripts in either ECMAScript or Groovy (of late only Groovy is
available so it is what was used with the latest reports).
So Each Pentaho report has script that accompanies it. Below is the script
written in Groovy:
{code:java}
def init(dataRow)
{
// place all initialization logic here. This is the right space to
// prepare complex lookup tables or to fill global variables. // this method
is called once when the data-source is first used.
var tenantUrl = dataRow.get("tenantUrl");
var user = dataRow.get("username");
var password = dataRow.get("password");
dataFactory.getConnectionProvider().setProperty("user", user);
dataFactory.getConnectionProvider().setProperty("password", password);
dataFactory.getConnectionProvider().setUrl(tenantUrl);
}
def shutdown()
{
// place all shutdown logic here. If you use any persistent resources
// like files or connections make sure you close them here.
// this method is called once during the data-source shut-down. It
// will be called after all query scripts have been shut down.
} {code}
So you will note that the script has 2 functions; one (init) for initiating a
connection, I would suppose it extracts the database connection information
from the request and the other (shutdown) currently isn't implemented as there
is no code (only comments). So my thinking is that the first function initiates
a connection, the queries are run, the report is generated. After all this is
done the connection that was initiated should be closed (probably the shutdown
function or some java code in fineract ), but closing is certainly not
happening here in the Groovy.
The comments in the shutdown function are the default ones and they seem to
highlight the same issue.
was (Author: JIRAUSER280240):
I have not interacted with Pentaho Reports long enough but I will try to
explain what I understand from what I have seen so far. Where I am not accurate
I think [~francisguchie] will chip in.
Designing a PENTAHO report involves doing the layout, specifying the queries
and also writing scripts in either ECMAScript or Groovy (of late only Groovy is
available so it is what was used with the latest reports).
So Each Pentaho report has script that accompanies it. Below is the script
written in Groovy:
{code:java}
def init(dataRow)
{
// place all initialization logic here. This is the right space to
// prepare complex lookup tables or to fill global variables. // this method
is called once when the data-source is first used.
var tenantUrl = dataRow.get("tenantUrl");
var user = dataRow.get("username");
var password = dataRow.get("password");
dataFactory.getConnectionProvider().setProperty("user", user);
dataFactory.getConnectionProvider().setProperty("password", password);
dataFactory.getConnectionProvider().setUrl(tenantUrl);
}
def shutdown()
{
// place all shutdown logic here. If you use any persistent resources
// like files or connections make sure you close them here.
// this method is called once during the data-source shut-down. It
// will be called after all query scripts have been shut down.
} {code}
So you will note that the script has 2 functions; one (init) for initiating a
connection, I would suppose it extracts the database connection information
from the request and the other (shutdown) currently isn't implemented as there
is no code (only comments). So my thinking is that the first function initiates
a connection, the queries are run, the report is generated. After all this is
done the connection that was initiated should be closed (probably the shutdown
function or some java code in fineract ), but closing is certainly not
happening here in the Groovy.
The comments in the shutdown function are the default ones and they seem to
highlight the same issue.
> Hikari Pool connection timed out. Tomcat crashes users cannot log in after
> --------------------------------------------------------------------------
>
> Key: FINERACT-1592
> URL: https://issues.apache.org/jira/browse/FINERACT-1592
> Project: Apache Fineract
> Issue Type: Bug
> Components: Performance, Reports
> Affects Versions: 1.6.0
> Reporter: Francis Guchie
> Assignee: Francis Guchie
> Priority: Major
> Attachments: TimeOutError-1.PNG, TimeOutError-2.PNG,
> TimeOutError.PNG, image-2022-04-22-11-25-32-303.png
>
>
> !image-2022-04-22-11-25-32-303.png!
--
This message was sent by Atlassian Jira
(v8.20.7#820007)