Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Performance / August 2003

Tip: Looking for answers? Try searching our database.

Problems in Connection pooling. Urgent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mithun Verma - 21 Aug 2003 10:50 GMT
Hello All,

My windows application has a form that needs to display fresh data to the user at short intervals (say every 10 seconds). For this purpose, I have included a timer. On every timer tick, I perform the database related operations to display the result to the user.
Note: Multiple instances of my application will be running at the same time and hence the timer running in each instance and initiation database operations.

With this approach, I started receiving errors like: Connection timed out. The connection pool has reached its maximum size because every request to the database opened and closed a connection. I changed the approach to:
Creating a single connection for the entire form so that all operations use the same open connection. The connection is closed when the form closes.
Even then, I now get the following type of errors:

a) 8/11/2003 3:21:40 PM    SqlUtility   Execute   Error: Transaction (Process ID 73) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
TimeTic Calling sp_ProductionTestBackgroundTask    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
  at IMD.OM.Database.SqlUtility.Execute(SqlParameter& prmOutParam, SqlConnection cnnCommon) in d:\khyatis\work\projects\imd\imdom\misc\sqlutility.cs:line 595
8/11/2003 3:21:40 PM    SC Status   Start NSC Monitor   Error:     at OM.Database.SqlUtility.Execute(SqlParameter& prmOutParam, SqlConnection cnnCommon) in d:\xyz\work\projects\\misc\sqlutility.cs:line 608
  at IMD.OM.SC.SCStatus.StartNSCMonitor(SqlConnection commonConnection) in d:\xyz\work\projects\scstatus.cs:line 564System.Data.SqlClient.SqlException: Transaction (Process ID 73) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
  at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
  at IMD.OM.Database.SqlUtility.Execute(SqlParameter& prmOutParam, SqlConnection cnnCommon) in d:\xyz\work\projects\\misc\sqlutility.cs:line 595

I need to get rid of the above problem.

Regards,
Mithun
Rex - 30 Aug 2003 13:21 GMT
For faster application, you can try rewrite sql statement to Stored procedure.

 "Mithun Verma" <mithunv@MAQSoftware.com> =92=E5=AB=BC=83=E4=B6=81:#qJ8sj8ZDHA.2632@TK2MSFTNGP12.phx.gbl...
 Hello All,

 My windows application has a form that needs to display fresh data to the user at short intervals (say every 10 seconds). For this purpose, I have included a timer. On every timer tick, I perform the database related operations to display the result to the user.
 Note: Multiple instances of my application will be running at the same time and hence the timer running in each instance and initiation database operations.

 With this approach, I started receiving errors like: Connection timed out. The connection pool has reached its maximum size because every request to the database opened and closed a connection. I changed the approach to:
 Creating a single connection for the entire form so that all operations use the same open connection. The connection is closed when the form closes.
 Even then, I now get the following type of errors:

 a) 8/11/2003 3:21:40 PM    SqlUtility   Execute   Error: Transaction (Process ID 73) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
 TimeTic Calling sp_ProductionTestBackgroundTask    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    at IMD.OM.Database.SqlUtility.Execute(SqlParameter& prmOutParam, SqlConnection cnnCommon) in d:\khyatis\work\projects\imd\imdom\misc\sqlutility.cs:line 595
 8/11/2003 3:21:40 PM    SC Status   Start NSC Monitor   Error:     at OM.Database.SqlUtility.Execute(SqlParameter& prmOutParam, SqlConnection cnnCommon) in d:\xyz\work\projects\\misc\sqlutility.cs:line 608
    at IMD.OM.SC.SCStatus.StartNSCMonitor(SqlConnection commonConnection) in d:\xyz\work\projects\scstatus.cs:line 564System.Data.SqlClient.SqlException: Transaction (Process ID 73) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
    at IMD.OM.Database.SqlUtility.Execute(SqlParameter& prmOutParam, SqlConnection cnnCommon) in d:\xyz\work\projects\\misc\sqlutility.cs:line 595

 I need to get rid of the above problem.

 Regards,
 Mithun

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.