BDM installation converts "i" letter to "İ"

Description

I am getting this error after i changed my OS langauge to Turkish and tried to install bdm. All my bdm tables which contains "i" letter created again with "İ" letter.

Environment

None

External Link

None

Workaround

None

Activity

Show:
Mehmet Sakir KUTLU
September 27, 2018, 10:37 AM

I tried it on fresh installed ubuntu 16.04, it has same error. I attached screenshot.


It's installed to postgresql-9.5.

locale output:
LANG=tr_TR.UTF-8
LANGUAGE=
LC_CTYPE="tr_TR.UTF-8"
LC_NUMERIC="tr_TR.UTF-8"
LC_TIME="tr_TR.UTF-8"
LC_COLLATE="tr_TR.UTF-8"
LC_MONETARY="tr_TR.UTF-8"
LC_MESSAGES="tr_TR.UTF-8"
LC_PAPER="tr_TR.UTF-8"
LC_NAME="tr_TR.UTF-8"
LC_ADDRESS="tr_TR.UTF-8"
LC_TELEPHONE="tr_TR.UTF-8"
LC_MEASUREMENT="tr_TR.UTF-8"
LC_IDENTIFICATION="tr_TR.UTF-8"
LC_ALL=

Antoine Mottier
October 30, 2018, 9:19 AM

Can you run:
SHOW LC_COLLATE;
and
SHOW LC_CTYPE;
To display the collation settings define at the database level? Note that this settings cannot be change after database creation. It might be a different value compare to the output of locale as locale command give information about the settings used by the operating system. I guess that by default when creating a database PostgreSQL reuse the operating system settings but they can probably be also override.

Mehmet Sakir KUTLU
October 30, 2018, 10:32 AM

here is result;

postgres=# SHOW LC_COLLATE;
lc_collate
-------------
tr_TR.UTF-8
(1 row)

postgres=# SHOW LC_CTYPE;
lc_ctype
-------------
tr_TR.UTF-8
(1 row)

Antoine Mottier
November 5, 2018, 1:25 PM

I think that I have know a better understanding of the issue.

When we generate the BDM Java classes we add some Hibernate (the ORM library we used) annotations to define the table name. This table name is set to the class name converted to upper case (see https://github.com/bonitasoft/bonita-engine/blob/7.7.4/services/bonita-business-data/bonita-business-data-generator/src/main/java/org/bonitasoft/engine/business/data/generator/EntityCodeGenerator.java#L129).
The upper case conversion used the locale used by the JVM (see https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#toUpperCase()). By default this will be the locale of your Operating System. So in your case, with tr_TR.UTF-8 it will convert the LATIN SMALL LETTER I to LATIN CAPITAL LETTER I WITH DOT ABOVE (see Unicode documentation ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt).
From PostgreSQL documentation you can see that "unquoted names are always folded to lower case". So the table name defined in upper case on Bonita/Hibernate side is lower case in PostgreSQL. For an unknown reason the CAPITAL LETTER I WITH DOT ABOVE is not lower to LATIN SMALL LETTER I to LATIN (I test on PostgreSQL `select lower('İ');` and it actually return the expected result `i`).

So currently I think one solution would be to add quotes to the table name to make the name case sensitive (see PostgreSQL documentation) or to force the locale to for example en_US.utf8 when generating the table name from the Business Object class name.

For you I guess the current workaround is to run your Tomcat bundle (or Bonita Studio) with locale set to en_US.utf8.

Antoine Mottier
April 2, 2019, 9:23 AM

Note that up to Bonita 7.8 and also in future Bonita 7.9 running Bonita with a Turkish locale is not supported.

For Bonita Studio you can define a different locale for:

Bonita Studio itself: by adding JVM parameter in the .ini file in Studio installation folder. For example by editing on Windows 64 the BonitaStudioCommunity64.ini file and adding at the end of the file:
{{-Duser.country=US
-Duser.language=en}}

Bonita Studio embedded Tomcat: go in Studio preferences, click on "Server settings" and in "Tomcat JVM additional settings" add {{ -Duser.country=US -Duser.language=en}}

For a Tomcat Bonita bundle, JVM system properties can be defined in the setenv file located in setup/tomcat-templates.

Assignee

Delphine Coille

Reporter

Mehmet Sakir KUTLU

Affects versions

Reference

BS-19108

Fix versions

None
Configure