MT Cache on a separate SQL Server
For specific scenarios, project-based or separated SQL storage can be used for MT cache. MT Cache is consisted of three table objects in database:
LTGearMTCacheData
LTGearMTCacheHit
LTGearMTCacheOrigin
You can create all those necessary objects with following script:
Please ask Service-desk to create a new database, dedicated for your project’s MT Cache purposes, set appropriate access rights (db owner) and run the script on it. Following structure is created on the SQL server:
Hash code in LTGearMTCacheData table
LTGearMTCacheData table contains a column with a ‘hash code’, computed from source string. This is necessary to fill the hash code while inserting new records to the database. To be consisted with MT Companion, your developers should use following routine for hash code computation:
static public class Hash
{
static public string GetHashAsNumber(string text)
{
var bytes = Encoding.UTF8.GetBytes(text);
int res = 0;
for (int i = 0; i < text.Length; i++)
{
res = res + (i * bytes[i]) % int.MaxValue;
}
return res.ToString();
}
}