Solved

ADO, Transaction and ASP

Posted on 2004-09-03
3
380 Views
Last Modified: 2008-02-01
Hi,

I've never used ado transactions before.
I will use it on asp pages.
So, can anybody correct my understanding, please?

1) my asp pages always open an ado connection at the begining,
and close the connection at the end.
Between open and close the connection, it executes DMLs and/or pass the connection to some recordsets.
So, as long as I use this connection, I can handle a transaction ?
I mean an ado transaction always belong to an connection?
And all I have to do is
to put conn.BeginTrans, define a flag, call conn.CommitTran or conn.RollbackTran.
Is it true?

2) what will happens if I call rs.update with adDynamic cursor type in a transaction?
Can the change be seen from others before committing the transaction?

3) About lock,
an asp inserts records into some tables
and updatess records in some tables in a transaction.
all the tables or pages locked until the changes are commited or rollbacked?
0
Comment
Question by:masa2004
  • 2
3 Comments
 

Accepted Solution

by:
leorich2001 earned 125 total points
ID: 11972530
1) my asp pages always open an ado connection at the begining,
and close the connection at the end.

no, It will open connection when neccesarry and close the connection as soon as possible.

Between open and close the connection, it executes DMLs and/or pass the connection to some recordsets.

So, as long as I use this connection, I can handle a transaction ?
yes you can

I mean an ado transaction always belong to an connection?
yes it is

And all I have to do is
to put conn.BeginTrans, define a flag, call conn.CommitTran or conn.RollbackTran.
Is it true?
yes
but please ensure that the process between transaction is as little as you can , so that you would have good performance

2) what will happens if I call rs.update with adDynamic cursor type in a transaction?
the table will be locked temporarirly, so no one can not read the table until you commit or rollback

Can the change be seen from others before committing the transaction?
No, It can't

3) About lock,
an asp inserts records into some tables
and updatess records in some tables in a transaction.
all the tables or pages locked until the .... EXACTLY
0
 

Author Comment

by:masa2004
ID: 11975447
leorich2001,

Let me make sure two things,

>no, It will open connection when neccesarry and close the connection as soon as possible.
does you mean, automatically open/close connection is handled by ado?
I EXPLICTLY call conn.open at the beginning and conn.close at the end in an asp page.
Is this approch ok? or do I need to call open/close more frequently in the middle of asp pages?

And,
>all the tables or pages locked until the .... EXACTLY
I believe that there are Optimistic lock and Pessimistic lock for recordset.
But in a transaction, ado seems using only pessimistic lock. Is it right?

Thanks.
0
 

Author Comment

by:masa2004
ID: 11993435
I got enough answer from leorich2001,
I left small questions though.

Thanks.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iframe detection of parent window scale 20 86
simplest php form 3 81
maven disable workspace resolution 1 24
Vector, list Questions R 6 32
This is an explanation of a simple data model to help parse a JSON feed
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

820 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