Re: Very strange SQL connection problem

From: Miha Markic [MVP C#] (miha)
Date: 11/24/04


Date: Wed, 24 Nov 2004 12:58:39 +0100

Stefan,

Try creating a *new instance* of SqlConnection and then open and after the
operation Dispose it.
You are only doing Open/Close AFAIK.

-- 
Miha Markic [MVP C#] - RightHand .NET consulting & development
SLODUG - Slovene Developer Users Group
www.rthand.com
"Stefan Kals" <stefan.kals@css-web.net> wrote in message 
news:41a46e77$1@e-post.inode.at...
>> Let us know.
>
> Ok, it didn't help.. :(
> Strange though that it seems always to "crash" after the application went 
> to
> sleep which i see through the cleared trace file (trace.axd).
>
> Let me shortly describe the important codelines getting executed, perhaps
> you could see something..
>
> --- Default.aspx.cs ---
> DataHandler handler = new DataHandler();
>
> --- DataHandler.cs ---
> SqlConnection con = new SqlConnection();
> con.ConnectionString = ....
> DataAdapter ad = new ...
> ad.Connection = ...
>
> --- Default.aspx.cs ---
> handler.OpenConnection();
>
> --- DataHandler.cs ---
> con.Open();
>
> --- Default.aspx.cs ---
> handler.GetSomeData();
>
> --- DataHandler.cs ---
> ad.Fill(someDataset);
>
> --- Default.aspx.cs ---
> handler.CloseConnection();
>
> --- DataHandler.cs ---
> con.Close();
>
> That's a little bit simplifyed but i can't see a problem with it..
> For testing purposes i know activated connection pooling by setting the
> connection string (in web.config) again and got the second exception after
> the 30 minutes:
>
> [FileLoadException: ?]
>   System.EnterpriseServices.Platform.Initialize() +0
>   System.EnterpriseServices.ResourcePool..ctor(TransactionEndDelegate cb)
> +11
>   System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl) +797
>   System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl
> ctrl) +170
>
> System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
> tionString options, Boolean& isInTransaction) +358
>   System.Data.SqlClient.SqlConnection.Open() +384
>   System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
> ConnectionState& originalState) +44
>   System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior) +304
>   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 
> startRecord,
> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
> behavior) +77
>   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
>   Kumpfmueller.Data.DataHandler.LoadCategoryDetails(DataSetCategory ds) in
> C:\Inetpub\wwwroot\Kumpfmueller\Data\DataHandler.cs:694
>   Kumpfmueller.Default.Page_Load(Object sender, EventArgs e) in
> C:\Inetpub\wwwroot\Kumpfmueller\Default.aspx.cs:81
>   System.Web.UI.Control.OnLoad(EventArgs e) +67
>   System.Web.UI.Control.LoadRecursive() +35
>   System.Web.UI.Page.ProcessRequestMain() +753
>
>
> My stomach says it must have to do with some SQL server settings or some
> strange SQL connection getting invalid thing or so...
> Why should it else be no problem at my dev machine (also during sessions
> which require the application to start up)?
>
> Stefan
>
> 


Relevant Pages

  • Very strange SQL connection problem
    ... System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ... System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, ... Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ASP.net and Oracle error System.Data.OleDb.OleDbException
    ... Here is some of my connection code: ... Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ... >> on our test web server, There is only one oracle home on the test server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Server Error in /MyWebForm Application
    ... SQL connection in VS.NET 2003, I test the connection and everything works ... MSDE server. ... Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Deploying Web Service to my hosting services server
    ... It means that neither ODBC nor ... > connection, ConnectionState& originalState) ... > startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: scalability of single SqlConnection instance
    ... Do you mean lock on the specific SqlConnection instance being used for the operation? ... Yes, you can consider a new "feature" that can permit multiple operations on a single connection, but it has so many side-effects, I don't recommend it. ... I think that technically my architecture is thread-safe (since only a single thread can make use of my single SqlConnection instance at once), but it's hardly a desirable way to do things. ...
    (microsoft.public.dotnet.framework.adonet)

Loading