Re: crystal reports unreleased connections

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Peter Proost (pproost_at_nospam.hotmail.com)
Date: 10/27/04


Date: Wed, 27 Oct 2004 16:55:54 +0200

Hi Bernie,

you got it!! Thnx a million times, There still is a little problem that's if
I call for example 5 reportForms like this

dim objReport as new frmReport
objReport.show

I've ofcourse got 5 connections, but when I close 4 of the report forms I
still got 5 connections but when I close the last form and leave my app
running I got 0 connections and that's good enough for me :-)

Thnx again I hope I can help you out some time

Greetz Peter and again thnx a million times

"Bernie Yaeger" <berniey@cherwellinc.com> wrote in message
news:uPqTXZCvEHA.3376@TK2MSFTNGP12.phx.gbl...
> Hi Peter,
>
> I have the answer!!!
>
> Place this in the closing event of the form that closes when the viewer
> closes:
> crreportdocument.Dispose()
>
> where crreportdocument is the reportdocument object that is the source for
> the report - eg,
>
> CrystalReportViewer1.ReportSource = crreportdocument
>
> This worked perfectly for me - I had 16 connections; when the report
viewer
> displays the report I had 17 connections; when I closed the viewer, I had
16
> again. You were disposing the viewer, but it is the reportdocument object
> that had to be disposed.
>
> I got this, if you can believe it, from crystal (business objects), after
> berating them for 2 days.
>
> Let me know if this solves your problem.
>
> Regards,
>
> Bernie
>
> "Peter Proost" <pproost@nospam.hotmail.com> wrote in message
> news:OwO0nDAvEHA.1372@TK2MSFTNGP14.phx.gbl...
>
> > Hi Bernie,
> >
> > thnx for your suggestions and help, I also had found the connect timeout
> > property in the reports but the problem is that at a certain time the
user
> > has so many sleeping connections that he can't open a report (= an extra
> > connection) and I think that the connect timeout property is the time
the
> > report trys to connect to the server, but I'm not sure. But if it is
what
> > you say it is, it will only cause the report to stay connected for a
> > longer
> > time, and that's the problem the reports staying connected ;-)
> >
> > If you've got any more hints,tips or thoughts they're welcome, and I'll
> > follow your advice and post the question in the
> > microsoft.public.dotnet.framework.adonet group and see what that gives.
> >
> > thnx again for thinking with me and if you have got an other idea I'm
very
> > interested in hearing it.
> >
> > Greetz Peter
> >
> >
> > "Bernie Yaeger" <berniey@cherwellinc.com> wrote in message
> > news:OY6kRs6uEHA.2192@TK2MSFTNGP14.phx.gbl...
> >> Hi Peter,
> >>
> >> Making a little - very little - progress.
> >>
> >> 1. I have a message into Crystal re the problem;
> >> 2. I notice that you can change the timeout property in the connection
> >> itself inside crystal reports. While I see no way there to edit the
> >> connection string itself re pooling, this may help. For example, it
> >> defaults to 15; I was able to change it to 1250 (presumably seconds)
> >> which
> >> may resolve the timeout issues you've encountered.
> >>
> >> Yes, it's a pain to have to change all of the reports' connection
> >> properties, but if that's what we down to, at least it may be a
solution.
> >> Let me know what you think.
> >>
> >> Bernie
> >>
> >> "Peter Proost" <pproost@nospam.hotmail.com> wrote in message
> >> news:%23LXu7YyuEHA.3900@tk2msftngp13.phx.gbl...
> >> > Hi Bernie,
> >> >
> >> > I wanted to test to set the pooling to false for the reports but I
> >> > think
> > I
> >> > can't set this property for the crystalreportsviewer connection,
> >> > because
> >> > it
> >> > seems to me that it manages it's own connections, I only have to pass
> > the
> >> > servername, databasename, userid and password to the
> >> > CrystalDecisions.Shared.Connectioninfo
> >> > There is CrystalDecisions.Shared.DbConnectionAttributes, maybe I can
> >> > set
> >> > it
> >> > here but I'm not sure how to use it.
> >> >
> >> > Greetz
> >> >
> >> > Peter
> >> >
> >> >
> >> > "Peter Proost" <pproost@nospam.hotmail.com> wrote in message
> >> > news:eDB#KNyuEHA.2096@tk2msftngp13.phx.gbl...
> >> >> Hi Bernie,
> >> >>
> >> >> First of all, thnx for your time&help. I know about connection
> >> >> pooling,
> >> > but
> >> >> the problem is that some of our users open and close reports all the
> > time
> >> >> and then when they're up to 20-30 sleeping connections in sql server
> > they
> >> >> start getting connection timeouts, and they have to reboot the
> >> >> program.
> >> > But
> >> >> I was wondering if there isn't a possibility to let crystal reports
> > only
> >> > use
> >> >> for example maximum 5 connections or something, because I don't
realy
> >> >> want
> >> >> to shut down connection pooling, because of it's advantages.
> >> >> thnx again
> >> >>
> >> >> Peter Proost
> >> >>
> >> >> "Bernie Yaeger" <berniey@cherwellinc.com> wrote in message
> >> >> news:O1m81WruEHA.2316@TK2MSFTNGP15.phx.gbl...
> >> >> > Hi Peter,
> >> >> >
> >> >> > It looks like there is a good reason for what you've encountered,
> >> >> > and
> > I
> >> >> was
> >> >> > aware of it but didn't really observe its behavior before.
> >> >> >
> >> >> > The issue is 'connection pooling'. In .net, open connections are
> >> >> > pooled
> >> >> and
> >> >> > reused, up to a maximum (I believe 100). They really don't hurt
> >> > anything
> >> >> > and provide for speedy reuse of a connection. If you want to shut
> >> >> > it
> >> >> down,
> >> >> > you can set pooling = false, but I'm told this is not a good idea.
> >> > Here's
> >> >> a
> >> >> > link that you may find helpful:
> >> >> >
> >> >> >
> >> >>
> >> >
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
> >> >> l/cpconConnectionPoolingForSQLServerNETDataProvider.asp
> >> >> >
> >> >> > HTH,
> >> >> >
> >> >> > Bernie Yaeger
> >> >> >
> >> >> > "Peter Proost" <pproost@nospam.hotmail.com> wrote in message
> >> >> > news:%23izb0kAuEHA.2000@TK2MSFTNGP14.phx.gbl...
> >> >> > > Hi Group,
> >> >> > >
> >> >> > > I've got an interesting problem, I don't know if this is the
right
> >> > group
> >> >> > > but
> >> >> > > I think so because everything I've read about it so far says
it's
> >> >> > > a
> >> > .net
> >> >> > > problem. Here's the problem, we're using crystal reports 9 and
> > vb.net
> >> >> and
> >> >> > > we're using the crystalrepotViewer to show our reports. But
every
> >> >> > > time
> >> >> we
> >> >> > > open a report the connection to or sql server remains, so if I
> >> >> > > open
> > 5
> >> >> > > forms
> >> >> > > with the report viewer I've got 5 sleeping connections in my sql
> >> > server.
> >> >> > > If
> >> >> > > I close all 5 forms I still got 5 open connections, and they
will
> > not
> >> > go
> >> >> > > away until I close the entire application. The problem with this
> >> >> > > is
> >> > that
> >> >> > > some user only use the app to print reports so after about an
hour
> > or
> >> > so
> >> >> > > they've got 80 sleeping connections. I've tried putting
> >> >> > > crystalreportviewer1.dispose in the form closing event but this
> >> >> > > has
> >> >> > > no
> >> >> > > effect. The crviewer also hasn't got a connection.close method
or
> >> >> > > something
> >> >> > > like that
> >> >> > > Any help would be very much appreciated
> >> >> > >
> >> >> > > Grtz Peter
> >> >> > >
> >> >> > >
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>



Relevant Pages

  • Re: Same problem here
    ... I have an Asus M3A with phenom 9950 and 4GBRAM ... Please report if you have any solutions, ... thnx in advance ...
    (alt.comp.periphs.mainboard.asus)
  • Re: cant copy user profile - Q291555 doesnt appear to address issue
    ... will try your suggestion and report back. ...
    (microsoft.public.windowsxp.security_admin)
  • Same problem here
    ... I have an Asus M3A with phenom 9950 and 4GBRAM ... Please report if you have any solutions, ... thnx in advance ...
    (alt.comp.periphs.mainboard.asus)
  • Printpreview settings..
    ... A report contains 2 pages. ... But I want the print preview standard to show 2 pages, ... Thnx in advance!! ... the Netherlands ...
    (microsoft.public.access.reports)
  • Re: Report on connections
    ... You could add a User cell to each shape and then run your ... FromSheet and ToSheet onto a report. ... The Visio SDK has a Code snippet "Drawing Navigator Using Connections" ... A simple example would be two processes A and B with B being dependent ...
    (microsoft.public.visio.general)