Hi Peter,
Below is a section on connection pooling that might be of value to you. It
indicates ways in which you can customize connection pooling using the
connection object. Try to set some of the parameters and let me know what
happens.
I'm a little concerned, though, about what you said - I'm wondering why your
users are encountering timeout problems and if this is really the result of
sleeping connections - let me know what you discover in this regard.
Bernie
--------------------------
Controlling Connection Pooling with Connection String Keywords
The ConnectionString property of the SqlConnection object supports
connection string key/value pairs that can be used to adjust the behavior of
the connection pooling logic.
The following table describes the ConnectionString values you can use to
adjust connection pooling behavior.
Name Default Description
Connection Lifetime 0 When a connection is returned to the pool, its
creation time is compared with the current time, and the connection is
destroyed if that time span (in seconds) exceeds the value specified by
Connection Lifetime. This is useful in clustered configurations to force
load balancing between a running server and a server just brought online.
A value of zero (0) will cause pooled connections to have the maximum
time-out.
Connection Reset 'true' Determines whether the database connection is
reset when being removed from the pool. For Microsoft SQL Server version
7.0, setting to false avoids making an additional server round trip when
obtaining a connection, but you must be aware that the connection state,
such as database context, is not being reset.
Enlist 'true' When true, the pooler automatically enlists the
connection in the current transaction context of the creation thread if a
transaction context exists.
Max Pool Size 100 The maximum number of connections allowed in the
pool.
Min Pool Size 0 The minimum number of connections maintained in the
pool.
Pooling 'true' When true, the connection is drawn from the appropriate
pool, or if necessary, created and added to the appropriate pool.
"Peter Proost" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:eDB#(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > 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/de...us/cpguide/htm
>> l/cpconConnectionPoolingForSQLServerNETDataProvider.asp
>> >
>> > HTH,
>> >
>> > Bernie Yaeger
>> >
>> > "Peter Proost" <(E-Mail Removed)> wrote in message
>> > news:%(E-Mail Removed)...
>> > > 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
>> > >
>> > >
>> >
>> >
>>
>>
>
>