|
-
May 15th, 2001, 11:41 PM
#1
Thread Starter
Hyperactive Member
Is MTS capable enough to do this?
Hi there!
I have 10 ASP pages, (all use the same database-but each page using a different table in the database). After going through all the 10 pages, the user is redirected to a page, which contains 'Commit' and 'Cancel' butttons. If the user clicks the Commit button, all the information enetered in those forms needs to be committed. On the other hand if he chooses the Cancel button, all the information entered should be rollbacked.
So I used the MTS. In the very first page, I have used <%@transaction=requires_New %> and in all other pages, I have given <%@transaction=Supported %>. In the 11th page, if the user clicks the 'Cancel' button, I am calling the ObjectContext.SetAbort method. If the user clicks the 'Commit' button, I am calling the ObjectContext.SetComplete method.
I thought this will work fine. But to my surprise, what the MTS is doing is it calls the SetAbort/SetComplete methods of ObjectContext at the end of the everypage.
I am using a SQL-Server database. What should I do to get the desired result? Please, please help me.
Thanx in Advance.
-
May 16th, 2001, 07:24 AM
#2
Good Ol' Platypus
A good idea would be to put all of the request.form/querystring variables into session variables.
Code:
Session("MyVar") = Request.[Form/QueryString]("MyVar")
Then at the end you can set up a connection object and a recordset object and loop through the tables. If they press commit put them to a page that does this. Otherwise you can submit them to, say, your home page.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 16th, 2001, 12:36 PM
#3
Frenzied Member
And I think that putting all the data into session variables is also a scalability killer. What if you have many users at once? What if you need to split the app across servers?
You should avoid using the session object whenever possible. There are more resource efficient ways to persist state.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
May 16th, 2001, 12:42 PM
#4
Best solution I have found is save all data as you go along into a Session variable that holds an xml document. Then save the data in the XML to the database when done.
-
May 16th, 2001, 12:53 PM
#5
Frenzied Member
That is a much better solution as it minimizes the Session object and thus conserves server resources.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
May 16th, 2001, 12:55 PM
#6
Guru
Since we're now trying to get the maximum scalability out of this simple question then I suppose we can use hidden form variables, querystrings and/or cookies to totally eliminate state
-
May 16th, 2001, 01:11 PM
#7
Frenzied Member
Even if MTS allowed it, it would be a huge scalability killer to keep those resources open on the server
Well.. uh.. you brought it up :c)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
May 16th, 2001, 01:15 PM
#8
Guru
I didn't mean to start a discussion on scalability, I only wanted to mention that MTS would use a huge amount of resources on the server if that were allowed. But I guess it doesn't matter.... Carry on!
-
May 16th, 2001, 11:02 PM
#9
Thread Starter
Hyperactive Member
Hi there!
Thank you all for the replies. I want to add one more point. Well, the user doesn't just enter data in the first 10 pages, but he can edit/delete the data present in those pages. So I found that MTS can't be used, because MTS doesn't support multiple span of pages. So I used ADO transaction methods.In order to do that I have used a session connection. But my question is, when a user visits the first page, the transaction is started. At this time is the table in the database locked? Because I am encountering a problem that no other user(seperate IE window-another session) is able to start the transaction in the same time. (I am getting the SQL-Server - Timeout expired error). I hope someone will give me the right solution. (At present the database is connected with a single username & password).
Thanx in advance.
-
May 16th, 2001, 11:54 PM
#10
Guru
As mentioned earlier, don't open a connection to the database and start your transactions until you get ALL of the data. Until you get ALL of the data, store the values in session variables/cookies/etc. After the user completes the process, take all of the values out of the data store (session/cookies/etc.) and insert them into the database all in one step
hope this helps
Tom
-
May 17th, 2001, 02:07 AM
#11
Thread Starter
Hyperactive Member
thanx Clunietp! But..
Hi Clunietp!
If I have to use your idea, then I have to store large amount of data in the session/cookies. Physically, that is impossible. I don't mind the scalability /performance for now. Because it is a intranet application. (Only 4 simultaneous users are expected at the maximum).
So please help me with the transaction methods of ADO, to work correctly.
Thanks once again!
But my question is, when a user visits the first page, the transaction is started. At this time is the table in the database locked? Because I am encountering a problem that no other user(seperate IE window-another session) is able to start the transaction in the same time. (I am getting the SQL-Server - Timeout expired error).
-
May 17th, 2001, 09:00 AM
#12
Thread Starter
Hyperactive Member
pls answer...
Hi there!
Please help me with this.
Thanx again!
-
May 17th, 2001, 11:02 AM
#13
Guru
How much data are we talking about here?
Maybe you can store your user data in a temp table (in the database) or something and give the user a GUID for a cookie that you can later refer to.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|