0

A java application using payara (glassfish) try to save the body of an email into a column into db (with eclipslink) We have the same application onto 2 different server,that differ for dbserver: the first one is with mariadb 10.1.26 (java 1.8.0_131), the second one with mysql 5.5.57 (java 1.8.0_144) The same mail from the first server throws

Local Exception Stack: 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.3.qualifier): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect string value: '\xEF\xBF\xBD1 h...' for column 'msg_body' at row 1

What is really strange for me is that with the second server the import goes flowless, no warning, body saved

We have already checked the configuration of the two server, and seems to be both equal The foloowing are exactly the same onto the 2 databases:

-All the table are with character_set_name latin1

-the variable collation are

collation_connection = utf8mb4_unicode_ci

collation_database = utf8mb4_general_ci

collation_server = utf8mb4_general_ci

As said, the two database have exactly the same conf. Do anybody have idea why one server is working and the other no?

user2946593
  • 63
  • 2
  • 11
  • related: https://stackoverflow.com/questions/11159118/incorrect-string-value-xef-xbf-xbd-for-column –  Oct 23 '17 at 17:19
  • Thank you for pointing me to that. In any case, it does not explain why the same application works differently onto the two system – user2946593 Oct 24 '17 at 09:33
  • Since your application is trying to persist a special symbol which is used to indicate the data is corrupted, I wouldn't be surprised if MariaDB contained a fix to refuse such data, because it's dangerous to store corrupted data. – OndroMih Oct 24 '17 at 09:43

1 Answers1

0

We did tons of test Seems that the differences was on the database server global variables, where the machine with mariadb had utf8mb4_general_ci, while mysql had latin1_swedish_ci Changing those value on mariadb server "seems" to have solved the problem

user2946593
  • 63
  • 2
  • 11