Link to home
Start Free TrialLog in
Avatar of Arlo Weston
Arlo WestonFlag for United States of America

asked on

Why SSRS Reports stop returning data after half-hour of siting?

We have SSRS with a lot of reports.  A while back I put it behind a WebForms ReportViewer control (We needed the "Back to Parent" button, but that is a different story...)  Everything worked fine until a few months ago.  If a user leaves a report open in the browser for over an hour (maybe even less), and is changing the parameters and rerunning the query, the query will hang for a few minutes, look like it is doing something, and then return when it has done nothing.  No error code is returned, just the original report.  I think it may be something in the WebForms? Here is the code, aspx.vb file:

Imports Microsoft.Reporting.WebForms

Partial Class _Default
  Inherits System.Web.UI.Page

  Public Property ReportUrl As String
  Public Property ReportPath As String

  Public Sub New()

    ReportPath = "/Miscellaneous/ReportServer2ErrorPage"

  End Sub

  Private Sub _Default_Load(sender As Object, e As EventArgs) Handles Me.Load

    Me.ReportViewer1.KeepSessionAlive = False
    Me.ReportViewer1.AsyncRendering = False


    If Not Page.IsPostBack Then
      
      Me.ReportViewer1.ProcessingMode = ProcessingMode.Remote

      Dim newRptPath = Request.QueryString("reportpath")
      If Not IsNothing(newRptPath) Then

        Dim findMe As Integer = InStrRev(newRptPath, "/")
        findMe = Len(newRptPath) - findMe
        Dim title As String = Right(newRptPath, findMe)
        Page.Header.Title = title

      End If


      If Not IsNothing(newRptPath) Then
        Me.ReportViewer1.ServerReport.ReportPath = newRptPath
      End If
    End If


  End Sub


Open in new window

And the aspx file:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="reportserver2.aspx.vb" Inherits="_Default" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXX" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title></title>
</head>
<body>
    <form id="form1" runat="server" >
        <asp:ScriptManager runat="server" ></asp:ScriptManager>

        <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Width="100%" Height="1000">
            <ServerReport ReportPath="/Miscellaneous/ReportServer2ErrorPage" ReportServerUrl="http://MyReportServer/RS" />
        </rsweb:ReportViewer>

    </form>
</body>
</html>

Open in new window

Any help would be appreciated!  Thank you
Avatar of HainKurt
HainKurt
Flag of Canada image

looks like connection pooling / timeout...

after a while, all connections are closed and pool is empty...
then whenever there is a new request and no available connection in the pool, it connect to the db, adds to the pool and uses it...

if you set MinPoolSize to say 3,
then there will always be 3 connection ready to be used
and you will not see that slowness...

set MinPoolSize  in your connection string...  " ...; Min Pool Size=3; ..." 
and see how it works...

SQL Server Connection Pooling (ADO.NET)

https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql-server-connection-pooling?redirectedfrom=MSDN
Avatar of Arlo Weston

ASKER

@HainKurt - I don't actually use a connection string.  Since I'm using the WebForms Report View control, I just point that to my SSRS server.  Your idea sounds like a good one, but I don't know where to apply it.  

-Arlo
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.