470,591 Members | 1,520 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

Transactions in an ASP Page

We are running a website on 3 W2K servers running IIS 5.0 as the webservers
and using a server running under Windows Server 2003 for the database
servers. All of our ASP pages are written using VBScript and we use COM
objects written in VB for our business logic.

One of our pages was written using a transaction. The page started with
@Transaction = Required. Basically a form posts to the page, the page
retrieves info from the form, it then uses one COM object to update a couple
SQL Server tables in one of our database, then it uses another COM object to
write a record to a text file in a Share on the database server, it then uses
a 3rd COM object to update some tables in a second database. Once it
completes these steps, it executes ObjectContext.CommitTransaction then
redirects the user to a different page.

This page has been working well for us for a few years. Then about 3 1/2
weeks ago, we changed our the database server to Windows Server 2003, it was
previously another W2K box. Since then this page hangs. I threw in some
debug statements that write to a text file on one of the webservers and I
found that every single one of the statements prior to
ObjectContext.CommitTransaction is executing but I never get past it. It
appears that since the transaction is never committed that the objects
created by the page are remaining and never getting cleaned up. Eventually
this hangs the whole server.

Since the problem started happening after we upgraded the database server to
Windows 2003, I'm wondering if anyone has ever heard of issues using ASP
Transactions when writing to text files on Windows 2003 servers from a W2K
server?

I removed the transaction from the page and it seems to work fine. I'm just
wondering if maybe there is another way so we can keep the transaction.

Thanks,

Evan Nelson

Here's a shortened version of the ASP page. When I commented out the lines
that I've put *** in front of the page seems to work.

***<% @Transaction = Required %>
<% Option Explicit
On Error Resume Next
** All the DIM statements are omitted
'Retrieve the registration information
lngConsultantID = Request.QueryString("ConsultantID")
lngChildren = Request.Form("children")
** Several Request.Form statements are omitted
'Save the registration information in the consultant tables
Set objConsultant = Server.CreateObject("Consult.Consultant")
objConsultant.Initialize(lngConsultantID)
strUserName = objConsultant.GetNewUserID
** Several lines that set properties on the object are omitted
objConsultant.UpdateStatus = 0
objConsultant.Update
** The next line actually makes an email account on a third party server - I
have verified that it has been created.
strErrorID = objConsultant.CreateMyEmail(strMyEmailAddress)
objConsultant.Release
Set objConsultant = Nothing
err.Clear

'Write out the registration information in the registration transfer file
** This is the COM object that is writing to the text file on the Database
server disk
share - I am seeing the record in the text file
** NOTE: If I commented out these lines the problem also went away.
Set objDataStore = Server.CreateObject("DataStore.DataWrite")
objDataStore.FileWrite CLng(lngConsultantID)
** The previous method call has more arguments that I have omitted
Set objDataStore = Nothing
err.Clear
' Build a WST Profile now that consultant has registered.
Set objWConsultant = Server.CreateObject("PHWebSalesTools.clsConsultant ")
blnIsValid = True
blnIsValid = objWConsultant.ReBuildWSTProfile( CLng(lngConsultantID),
vntConsultantData )
vntConsultantData = ""
blnIsValid = objWConsultant.isValidConsultant(strUserName,
Request.Form("password"), "", vntConsultantData)
Set objWConsultant = Nothing
err.Clear

If blnIsValid Then
strFullName = ( Trim(vntConsultantData(FIRST_NAME,0)) & " " &
Trim(vntConsultantData(LAST_NAME,0)) )
**Several lines that retrieve info from the vntConsultant are removed

' Create a Session and load default information
Set objSession = Server.CreateObject("PHWebSalesTools.clsSession")
strErrorID = objSession.CreateSession(lngConsultantID, strLanguageID,
vntSessionID)
strErrorID = objSession.preLoadConsultantData(vntSessionID, lngConsultantID)
** Several lines that set more properties of objSession have been
omitted Set objSession = Nothing
err.Clear
End If
ObjectContext.SetComplete
strResponse = ("registerok.asp?sessionid=" & vntSessionID)
Response.Redirect strResponse
%>

Jul 22 '05 #1
1 1596
I have not heard of this, but the security model is changed in Windows 2003.
I would have one of the network admins research the security aspects, as this
sounds like your issue.

I am not understanding the transaction wrapping code that writes text files,
however. Is this the method you are using to store data, or merely another
step in the process of storing data?

Without seeing the code, I cannot suggest other potential optimizations.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Evan Nelson" wrote:
We are running a website on 3 W2K servers running IIS 5.0 as the webservers
and using a server running under Windows Server 2003 for the database
servers. All of our ASP pages are written using VBScript and we use COM
objects written in VB for our business logic.

One of our pages was written using a transaction. The page started with
@Transaction = Required. Basically a form posts to the page, the page
retrieves info from the form, it then uses one COM object to update a couple
SQL Server tables in one of our database, then it uses another COM object to
write a record to a text file in a Share on the database server, it then uses
a 3rd COM object to update some tables in a second database. Once it
completes these steps, it executes ObjectContext.CommitTransaction then
redirects the user to a different page.

This page has been working well for us for a few years. Then about 3 1/2
weeks ago, we changed our the database server to Windows Server 2003, it was
previously another W2K box. Since then this page hangs. I threw in some
debug statements that write to a text file on one of the webservers and I
found that every single one of the statements prior to
ObjectContext.CommitTransaction is executing but I never get past it. It
appears that since the transaction is never committed that the objects
created by the page are remaining and never getting cleaned up. Eventually
this hangs the whole server.

Since the problem started happening after we upgraded the database server to
Windows 2003, I'm wondering if anyone has ever heard of issues using ASP
Transactions when writing to text files on Windows 2003 servers from a W2K
server?

I removed the transaction from the page and it seems to work fine. I'm just
wondering if maybe there is another way so we can keep the transaction.

Thanks,

Evan Nelson

Here's a shortened version of the ASP page. When I commented out the lines
that I've put *** in front of the page seems to work.

***<% @Transaction = Required %>
<% Option Explicit
On Error Resume Next
** All the DIM statements are omitted
'Retrieve the registration information
lngConsultantID = Request.QueryString("ConsultantID")
lngChildren = Request.Form("children")
** Several Request.Form statements are omitted
'Save the registration information in the consultant tables
Set objConsultant = Server.CreateObject("Consult.Consultant")
objConsultant.Initialize(lngConsultantID)
strUserName = objConsultant.GetNewUserID
** Several lines that set properties on the object are omitted
objConsultant.UpdateStatus = 0
objConsultant.Update
** The next line actually makes an email account on a third party server - I
have verified that it has been created.
strErrorID = objConsultant.CreateMyEmail(strMyEmailAddress)
objConsultant.Release
Set objConsultant = Nothing
err.Clear

'Write out the registration information in the registration transfer file
** This is the COM object that is writing to the text file on the Database
server disk
share - I am seeing the record in the text file
** NOTE: If I commented out these lines the problem also went away.
Set objDataStore = Server.CreateObject("DataStore.DataWrite")
objDataStore.FileWrite CLng(lngConsultantID)
** The previous method call has more arguments that I have omitted
Set objDataStore = Nothing
err.Clear
' Build a WST Profile now that consultant has registered.
Set objWConsultant = Server.CreateObject("PHWebSalesTools.clsConsultant ")
blnIsValid = True
blnIsValid = objWConsultant.ReBuildWSTProfile( CLng(lngConsultantID),
vntConsultantData )
vntConsultantData = ""
blnIsValid = objWConsultant.isValidConsultant(strUserName,
Request.Form("password"), "", vntConsultantData)
Set objWConsultant = Nothing
err.Clear

If blnIsValid Then
strFullName = ( Trim(vntConsultantData(FIRST_NAME,0)) & " " &
Trim(vntConsultantData(LAST_NAME,0)) )
**Several lines that retrieve info from the vntConsultant are removed

' Create a Session and load default information
Set objSession = Server.CreateObject("PHWebSalesTools.clsSession")
strErrorID = objSession.CreateSession(lngConsultantID, strLanguageID,
vntSessionID)
strErrorID = objSession.preLoadConsultantData(vntSessionID, lngConsultantID)
** Several lines that set more properties of objSession have been
omitted Set objSession = Nothing
err.Clear
End If
ObjectContext.SetComplete
strResponse = ("registerok.asp?sessionid=" & vntSessionID)
Response.Redirect strResponse
%>

Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Iain Mcleod | last post: by
11 posts views Thread by Mike P | last post: by
reply views Thread by psb | last post: by
1 post views Thread by John Wells | last post: by
5 posts views Thread by Allan Ebdrup | last post: by
12 posts views Thread by Rami | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.