473,382 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Begin and commit transaction

Hello

I am writing an ASP.NET / SQL-Server application and wanting to know when to
connect/begin-transaction and commit/disconnect.

I have a common module which I call at the beginning of Page_Load which,
when instantiated performs the connect/begin-transaction. The page then
does what it has to do (eg when a Save button is clicked it will do a
read/write to the database within the btnSave_Clicked event). At the end of
the 'event' (eg btnSave_Clicked) I then do a commit/disconnect.

My question is, is this when the commit/disconnect should be called or is
there an event within the page that gets fired after all click events have
been run and just before the page displays. I know there's a finalize but
is this where these types of tasks are performed.

Or is there another easier/standardized way this is all done.

Cheers
Horace


Nov 21 '05 #1
1 4378
Hi,

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
----------------
"Horace" <so******@nowhere.com> wrote in message
news:qh*************@nnrp1.ozemail.com.au...
Hello

I am writing an ASP.NET / SQL-Server application and wanting to know when to
connect/begin-transaction and commit/disconnect.

I have a common module which I call at the beginning of Page_Load which,
when instantiated performs the connect/begin-transaction. The page then
does what it has to do (eg when a Save button is clicked it will do a
read/write to the database within the btnSave_Clicked event). At the end of
the 'event' (eg btnSave_Clicked) I then do a commit/disconnect.

My question is, is this when the commit/disconnect should be called or is
there an event within the page that gets fired after all click events have
been run and just before the page displays. I know there's a finalize but
is this where these types of tasks are performed.

Or is there another easier/standardized way this is all done.

Cheers
Horace

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: faris_idris | last post by:
Hello, we are using Oracle 9i for client and server and Powerbuilder 8.0.3. We have a database link between two databases, whenever I try to do a simple select, update or insert I get the following...
11
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to...
1
by: Steve Thorpe | last post by:
Hi have have two linked SQL Servers and I am trying to get things working smootly/quickly. Should I be using 'BEGIN TRANSACTION' or 'BEGIN DISTRIBUTED TRANSACTION' ? Basicly, these SPs update...
4
by: Leaf | last post by:
Greetings, I've been reading with interest the threads here on deadlocking, as I'm finding my formerly happy app in a production environment suddenly deadlocking left and right. It started...
2
by: gabriel | last post by:
Greetings, I am adding foreign keys to a database and saving the generated scripts. What I do not understand is that all script begin with empty transactions. Why ? Example follows : /*
3
by: Mark | last post by:
If a java applicaiton using the type 4 driver calls a DB2 stored procedure, does the stored procedure need to do its own commit when updates are completed? If the stored procedure does a commit or...
1
by: Jason Huang | last post by:
Hi, I am just wondering how do we test the transaction's Commit and Rollback? How do we simulate a situation to let the transaction fail then Rollback? Thanks for help. Jason
1
by: ammar_fake | last post by:
Hello! I have an Oracle linked server connected through MSDAORA. Linked server queries work perfectly - the "openquery" ones as well as the 4-part-named ones. The problem I have is with...
0
by: cmrhema | last post by:
Hello I am using Asp.net with VC# having backend SQL SERVER I have written a procedure in sqlserver as below. It does not throw any error in sqlserver. This is the procedure set ANSI_NULLS...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.