Transaction And Locking

  • I have a asp.net application which is used intranet by the client. The hospital patient turn over is 900 per day and at least 40 users use the application at one time. I have used transaction wherever there is multiple table insert involved as transactions lock the DB instead of a row / table the application becomes a bit slow. Please advise.

  • Its little bit tough to get advice on such a wide topic

    Three simple steps.

    1) Use appropriate isolation levels.

    2) Reduce transaction time by limiting number of commands inside the transaction. (Do all selects, calculations etc before beginning a transaction)

    3) Use proper indexing (most important). You can get enough reading on this topic in this site written by veterans

    ----------------------------------------------------------------------------------------------------------------------------------------------------
    Roshan Joe

    Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • And this isn't a data corruption topic - please post in the appropriate forum. Thanks.

    Paul Randal
    CEO, SQLskills.com: Check out SQLskills online training!
    Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
    SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
    Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005

  • jsheikabdullah (11/23/2009)


    I have a asp.net application which is used intranet by the client. The hospital patient turn over is 900 per day and at least 40 users use the application at one time. I have used transaction wherever there is multiple table insert involved as transactions lock the DB instead of a row / table the application becomes a bit slow. Please advise.

    I don't understand what you mean by transaction locking DB instead of row because SQL Server since version 7.0 uses row level locking. If your code is locking DB instead of row then there are many things wrong with your application. That includes design, layout and use of the many transactions available to Asp.net since .NET 2.0 in 2005. Check below for how to create your own data layer or use Enterprise Library, you must know if you need to use Enterprise Library as your DAL(data access layer) you should go to the Asp.net forum to look for existing code and tools.

    http://aspalliance.com/837_Implementing_a_Data_Access_Layer_in_C

    Kind regards,
    Gift Peddie

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply