Hi, guys
I added a function to my cmdbuild's database,in order to add this function to the cmdbuild's datasource, I tried to clear the cache,but after I cleared the cache, I can't log in the cmdbuild system and stop at the CMDBuild screen.(IE/Chrome)
Here is the details:
Centos 7.2
java version "1.8.0_77"
apache-tomcat-8.0.47
postgresql-9.4.1208
phpPgAdmin 5.1 (PHP 5.4.16)
cmdbuild-2.5.0
1. Use phpPgAdmin to add a function, public -> Functions ->「Create SQL/PL function」, add a function as the below:
・name:TestView
・Returns:SET OF Record
・Programming language:SQL
・Arguments:null
・Definition:
---
SELECT "TestTable"."Id",
"TestTable"."Code",
"TestTable"."Description",
"TestTable"."Status"
FROM "TestTable"
---
・Comment:「TYPE: function」
2. Back to the CMDBuild -> Administration module, click the Setup -> Clear Cache.
3. Click the Data management module,It will be stopped at the first screen.
---
title: CMDBuild
text: Open Source Configuration and Management Database
Copyright © Tecnoteca srl
---
Is there any solution to solve this problem, Thanks.
Hi,
have you tried to execute the function manually? The function has probably an error that prevents CMDBuild from starting.
In your function you are returning a set of records, but you haven't defined any output column in your function, you need to add an "OUT" parameter in the definition of the function for each column you want to retrieve from the select of your function.
An example of correct definition would be:
CREATE OR REPLACE FUNCTION public."TestView"(
OUT "Id" integer,
OUT "Code" character varying,
OUT "Description" character varying,
OUT "Status" char
)
RETURNS SETOF record AS
$BODY$
SELECT "CI"."Id",
"TestTable"."Code",
"TestTable"."Description",
"TestTable"."Status"
FROM "TestTable"
$BODY$
LANGUAGE sql VOLATILE
COST 100
ROWS 1000;
COMMENT ON FUNCTION public."TestView"() IS 'TYPE: function';
I suggest you to drop the function, create it again with the correct definition and restart the tomcat. Everything should be fine again.
Regards,
CMDBuild Team
Previously lijun wrote:
Hi, guys
I added a function to my cmdbuild's database,in order to add this function to the cmdbuild's datasource, I tried to clear the cache,but after I cleared the cache, I can't log in the cmdbuild system and stop at the CMDBuild screen.(IE/Chrome)
Here is the details:
Centos 7.2
java version "1.8.0_77"
apache-tomcat-8.0.47
postgresql-9.4.1208
phpPgAdmin 5.1 (PHP 5.4.16)
cmdbuild-2.5.0
1. Use phpPgAdmin to add a function, public -> Functions ->「Create SQL/PL function」, add a function as the below:
・name:TestView
・Returns:SET OF Record
・Programming language:SQL
・Arguments:null
・Definition:
---
SELECT "TestTable"."Id",
"TestTable"."Code",
"TestTable"."Description",
"TestTable"."Status"
FROM "TestTable"
---
・Comment:「TYPE: function」
2. Back to the CMDBuild -> Administration module, click the Setup -> Clear Cache.
3. Click the Data management module,It will be stopped at the first screen.
---
title: CMDBuild
text: Open Source Configuration and Management Database
Copyright © Tecnoteca srl
---
Is there any solution to solve this problem, Thanks.
hi,CMDBuild Team
Thanks for your comment.
I followed your suggestion, and It's Ok now.
Previously Tecnoteca wrote:
Hi,
have you tried to execute the function manually? The function has probably an error that prevents CMDBuild from starting.
In your function you are returning a set of records, but you haven't defined any output column in your function, you need to add an "OUT" parameter in the definition of the function for each column you want to retrieve from the select of your function.
An example of correct definition would be:
CREATE OR REPLACE FUNCTION public."TestView"(
OUT "Id" integer,
OUT "Code" character varying,
OUT "Description" character varying,
OUT "Status" char
)
RETURNS SETOF record AS
$BODY$
SELECT "CI"."Id",
"TestTable"."Code",
"TestTable"."Description",
"TestTable"."Status"
FROM "TestTable"
$BODY$
LANGUAGE sql VOLATILE
COST 100
ROWS 1000;
COMMENT ON FUNCTION public."TestView"() IS 'TYPE: function';
I suggest you to drop the function, create it again with the correct definition and restart the tomcat. Everything should be fine again.
Regards,
CMDBuild Team