[CORE-227] Add ability to send parameters with string based variables as varchar instead of nvarchar Created: 22/Sep/16  Updated: 17/Oct/16  Resolved: 17/Oct/16

Status: Closed
Project: i2b2 Core Software
Component/s: CRC Cell
Affects Version/s: 1.7.07
Fix Version/s: 1.7.08

Type: New Feature Priority: Major
Reporter: Janice Donahoe Assignee: Janice Donahoe
Resolution: Completed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Rank: 0|i0031j:
i2b2 Sponsored Project/s:
i2b2 Core
Affects Database/s:
SQL Server
Participant/s:

 Description   
Currently when prepared statements are used to pass in string based variables, the parameters are sent in the SQL statement as Unicode (nvarchar) instead of varchar. The SQL Server then has to explicitly convert the nvarchar to varchar in the query. The effect is that the SQL Server optimizer may have to use an index scan instead of an index seek, which is the faster of the two.

The solution is to add a new connection parameter to the datasource definition. The value defined for this new connection parameter will determine whether the parameters with string based variables are sent as nvarchar or varchar.

Parameter: <connection-property name="sendStringParametersAsUnicode">
Located in:
Behavior:
    Value = ‘false’ the parameter will be sent as varchar
    Value = ‘true’ the parameter will continue to be sent as Unicode (‘nvarchar’)

If the parameter is missing the system will continue with the current logic.

IMPORTANT: This change only affects SQL Server databases.


 Comments   
Comment by Janice Donahoe [ 17/Oct/16 ]
This change was included in version 1.7.08, which was released on 10/07/2016.
Generated at Tue Apr 23 07:42:24 UTC 2024 using Jira 8.20.11#820011-sha1:0629dd8d260e3954ece49053e565d01dabe11609.