on 05-31-2018 2:34 PM
Hi,
I have a windows service written in C# which exports PDF reports. After successful execution of process, I see that there is last connection always left in database in sleeping mode. As i have hundreds of report, the sleeping connections keep on piling in database causing instability.
I use Crystal Reports for .NET Framework 4.0 version 13.0.2000.0 and Runtime version v2.0.50727
I get the sleeping connection for the last procedure in crystal report, when the following line runs
ReportDocument.Export(exportOptions);
Is it a known bug that crystal report leaves the last connection in database? I didn't found any forceful logoff method in C# to close the connection. Appreciate your help on this.
Thanks
In addition to what Don said, are you explicitly disposing of the ReportDocument after you export it?
Some of the Crystal SDK is still based on COM objects, which .NET doesn't memory manage very well, so you have to either use the ReportDocument in a "using" clause that will automatically dispose of it when you're done using it or you have to explicitly call .Dispose() on it when you're done with it. This should cause the report to disconnect from the database and free up any memory that it's using.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.