U4-5539 - Fix up Sql expression helpers and translators to ensure all SQL calls are made with true SQL parameters

Created by Shannon Deminick 23 Sep 2014, 07:12:04 Updated by Shannon Deminick 29 Sep 2014, 06:31:03

Relates to: U4-5556

If using PetaPoco without using true SQL parameters, a slight memory leak will occur. For example if you run this query:

for (int i = 0; i < 1000; i++) { DatabaseContext.Database.Fetch( "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='" + i + "'"); }

It will keep 1000 items of this SQL key in it's cache - and since that cache is static it will exists in memory until the app is restarted.

Further more, this PetaPoco dictionary uses the full SQL string as it's key and SQL statement can be pretty long, so changing this key to be an MD5 hash of the string would also save on some memory since the strings would be far smaller.

Comments

Priority: Major

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.0.0, 6.1.0, 7.0.0, 7.1.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.1.1, 6.0.6, 6.0.5, 6.0.7, 6.1.2, 6.2.0, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 7.0.1, 7.0.2, 7.0.3, 7.0.4, 7.1.1, 7.1.2, 7.1.3, 6.2.1, 7.1.4, 7.1.5, 6.2.2, 7.1.6

Due in version: 7.1.7, 6.2.3

Sprint:

Story Points:

Cycle: