forked from content-manager-sdk/Community
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
52 lines (47 loc) · 1.15 KB
/
Program.cs
File metadata and controls
52 lines (47 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HP.HPTRIM.SDK;
using System.Diagnostics;
using System.Configuration;
namespace HP.HPTRIM.SDK.Samples.BulkLoading
{
class Program
{
static void Main(string[] args)
{
try
{
using (Database db = new Database())
{
db.Id = ConfigurationManager.AppSettings["dbid"];
//db.WorkgroupServerName = "local";
if (db.IsValid)
{
// A technique for tracking non-disposed objects. There are currently only two objects that can/need to be disposed in
// the HP RM SDK: Database and TrimMainObjectSearch
TrimApplication.EnableSdkLeakTracking(true);
bulkLoaderSample loader = new bulkLoaderSample();
loader.run(db);
if (TrimApplication.GetSdkLeakCount() > 0)
{
foreach (string stackTrace in TrimApplication.GetSdkLeakStackTraces())
{
Trace.WriteLine(stackTrace);
}
}
}
else
{
Console.WriteLine("Loader database error: " + db.ErrorMessage);
}
}
}
catch (Exception exc)
{
Console.WriteLine("Caught exception: " + exc.Message);
}
}
}
}