11-18-2013 05:35 PM
I'm new here so not sure if this is the right place for these type of posts.
Currently using the TRIM API in C# dot net to develop a search via the document content search clause but I am getting inconsistent results.
Using the TRIMSDK.RecordSearch object and calling the AddDocumentContentClause to pass in the search criteria.
For example, if I use "attract*" as the search criteria, I get back 10 records, follow by another search with "sala*", and I get back 16 records. I then execute another search with "attract*" and this time I get back 14 records (instead of 10 and these 4 additional records seems to be from the "sala*" search)
These searches are executed one after the other (when the previous search has completed successfully)
Wonder if anyone has experienced similar issues?
11-19-2013 05:52 AM
11-19-2013 05:35 PM
Here is the code that I used, let me know what I've done wrong or if I made some silly mistakes. Thanks.
private void btnSearch_Click(object sender, EventArgs e)
TRIMSDK.IDatabase newDb = new TRIMSDK.Database();
StringBuilder resultText = new StringBuilder("");
newDb.WorkgroupServerName = "ServerName";
newDb.Id = "BDID";
newDb.WebServerWorkPath = "C:\\Temp";
TRIMSDK.RecordSearch objSearch = newDb.NewRecordSearch();
TRIMSDK.Records returnRecords = objSearch.GetRecords();
resultText.Append("Search String : " + (returnRecords as TRIMSDK.RecordsClass).Title + "\r\n");
resultText.Append("Total Records : " + (returnRecords as TRIMSDK.RecordsClass).Count.ToString() + "\r\n");
TRIMSDK.Record returnRecord = returnRecords.Next();
while (returnRecord != null)
resultText.Append("ID : " + returnRecord.Number + "\r\n");
resultText.Append("Title : " + returnRecord.Title + "\r\n");
returnRecord = returnRecords.Next();
objSearch = null;
returnRecords = null;
txtResult.Text = resultText.ToString();
newDb = null;
11-20-2013 02:07 AM
Other than a ReleaseComObject (objSearch) and on returnRecords that I would include, I am struggling to see the problem, as each search is a separate database and record search object.
11-20-2013 04:56 PM
I have added these following lines of code but issue remains.
objSearch = null;
returnRecords = null;
I have however made an observation, if I ran the search queries straight away, one after the other, the issue persists. However if I wait for 1 minute between the queries, issue did not appear (behaving as per normal).
11-20-2013 05:27 PM
11-20-2013 05:51 PM
Internal Code 63244
Does this help?
If it's possible, could you explain what you meant by temporary table used to join the content index to records wasn't being purged? Is this a "feature" or "Bug" or something that I could "control" or change in HP TRIM or the oracle database?
Thanks for your help.
11-20-2013 06:41 PM
It's a bug. When you execute a document content search, TRIM will "shell out" a query to the index. The index returns a set of URIs which related to the TSRECORD table. TRIM will store those URIs in a temporary table and join that across to the TSRECORD table. The problem with Oracle was that those temporary tables weren't being purged routinely (and were lingering around longer than desirable). Since this is all done by the workgroup server you can't just use a newer version of the SDK.
This was marked as fixed in 184.108.40.2060. You should check the build on the server to see that it matches.
I'm really guessing here, but I've heard of this before and know it was later fixed.
If the server is on the correct build (1150+) then I would suggest you double-check that your Oracle Client Drivers match the exact build of your oracle server. Meaning, if your Oracle server is 10.0.2.2 then the client drivers installed on TRIM must also be 10.0.2.2. It is a common thing that IT will install newer (or even older) client tools. Make sure they match.
Outside of that maybe submit a support ticket to HP.
11-20-2013 06:57 PM
I shall check with our DBAs on the server build for TRIM (making sure it's 1150+) Is there anywhere in HP site that I could view this "fix" as marked in 220.127.116.110?
Another question, if the Oracle server is 10.0.2.2, does it matter if our client drivers are newer (like 10.0.3 or something)?
Thanks for all the help, I shall chase down these few other details to investigate.
11-20-2013 07:03 PM
If you're using Oracle and you're having weird issues with TRIM, a lot of times the culprit is using a driver build other than the one matching the server. Best practice is to make sure they match.
The fix is listed in the SPER report for build 1150.
11-20-2013 07:13 PM
11-20-2013 07:28 PM
So I guess I might have to open a case with HP for further investigation....unless there is something else I could investigate.
11-20-2013 07:30 PM
11-20-2013 07:33 PM