Bug #71038 Add an option for custom collations detection
Submitted: 29 Nov 2013 9:56 Modified: 10 Jan 2014 0:27
Reporter: Alexander Soklakov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S5 (Performance)
Version:5.1.28 OS:Any
Assigned to: Alexander Soklakov CPU Architecture:Any

[29 Nov 2013 9:56] Alexander Soklakov
Description:
ConnectionImpl.buildCollationMapping() method called each time on connection instantiation. This method is used to detect non-standard charsets/collations configured on server and if cacheServerConfiguration=false this method takes about 25-30% of time for connection establishing. It's not appropriate for default driver behaviour because custom charsets/collations are rarely used.

How to repeat:
Profile ConnectionImpl.getInstance()

Suggested fix:
Add a driver connection property "detectCustomCollations=[true|false]" with default "false".
[10 Jan 2014 0:27] Daniel So
Added the following entry to the Connector/J 5.1.29 changelog:

"Added a new connection property detectCustomCollations=[true|false]. When its value is false (which is the default value), the ConnectionImpl.buildCollationMapping() method, for detecting non-standard character sets or collations, will NOT be called during the instantiation of a connection, thus shortening the time for establishing a connection.

The introduction of this new property with the default value of false alters the old default behaviour of calling ConnectionImpl.buildCollationMapping() at each connection. If non-standard character sets or collations might be used, users should set detectCustomCollations=true."
[10 Jan 2014 0:28] Daniel So
Posted by developer: