Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ADO, Transaction and ASP

Posted on 2004-09-03
3
Medium Priority
?
386 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Simple Linear Regression

916 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