CMDBuild Forum

Problem import csv in multitenant mode

Dear All,

I have a problem in import from csv file in a table with multitenant mode. All cards cannot import and the log error mention “generic error” with detail is "org.cmdbuild.dao.DaoException: error executing insert for entry = CardImpl{id=null, code=32.11.15.2005.001.001, type=rukun_tetangga}, caused by: "
Is it a bug of program or any missconfiguration in the application?

Cheers

Deni

Hi, I’ll need some additional information to verify your error, what version of CMDBuild are you using? Are you performing this action as SuperUser or with other groups? Also which multitenant mode are you using on that class? If you can, please attach the full stacktrace of the error.

Thanks in advance

Hi, I use CMDBuild 3.2. I’m sorry, the error is caused by my customized trigger :

slight_smile:CREATE FUNCTION public.autofillidtenant()
RETURNS trigger
LANGUAGE ‘plpgsql’
COST 100
VOLATILE NOT LEAKPROOF
AS $BODY$
BEGIN
NEW.“IdTenant” := _cm3_utils_operation_tenants_get();
RETURN NEW;
END $BODY$;

I Found the solution NEW.“IdTenant” := (_cm3_utils_operation_tenants_get())[1];

However, how can I avoid using this trigger? I create this trigger, because when import csv data, IdTenant is not filled. If I entry the data manually, is OK.

Regards,

Hi,
we investigated and it appears to be a bug, it has been already solved and the fix will be available in the next release. Thanks for the report.