Solved

Problem with SQL  transaction

Posted on 2009-04-06
2
267 Views
Last Modified: 2012-05-06
Hello,

I have a set of queries which are being executed on a page and on click of submit button I am doing all the required updates and finishing it off... My Problem is.. If someone closes the page before clicking on submit, Then my table becomes incomplete... And it creates a lot of problems...

So i thought i would using SqlTransaction, But in that the table is getting locked, and i cannot access the table for quite some time...
So please help me resolve this issue, If there is an alternative for SqlTransaction please let me know..

Thanks in advance,
Priya

0
Comment
Question by:Priyadarshni
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Expert Comment

by:udaya kumar laligondla
ID: 24075306
instead use intermediate storage to store the information before saving to the table. for ex
Create a temp table as #temp+SessionID which will be unique. copy all the initial data in to the table. on click of submit begin transaction and copy the data from temp table to main table then commit the trans if no error. drop the temp table
you will have to clear the temp tables if the sessions are terminated in the middle.
0
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 500 total points
ID: 24075328
If you are having a set of queries to be covered within a transaction, then you can Create a Procedure and put all the set of queries within that procedure. Provide logics to the Procedure on when to Rollback or commit a transaction.

Above will help you to avoid Transactions spanning across when the Page is closed in the middle.
If Creating a procedure will not be fruitful in your scenario, then try the ones listed below:

http://books.google.co.in/books?id=IykBBnWqyugC&pg=PA504&lpg=PA504&dq=alternative+to+Sql+Transaction&source=bl&ots=Kb7xAfcqy8&sig=jZUr9OFdLHr1xtABDhB676c-pvY&hl=en&ei=usDZScX5KKbg6gPi26DkCg&sa=X&oi=book_result&ct=result&resnum=3
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question