Groups | Blog | Home
all groups > inetserver asp components > october 2003 >

inetserver asp components : @transaction=required - results in hang after error thrown


jegs313 NO[at]SPAM hotmail.com
10/9/2003 6:21:34 AM
I have an asp page that uses the @TRANSACTION=REQUIRED directive.

Within the page I create two of my vb com+ components that are marked
require transaction. If my first call throws an error I trap and
clear. Then I try to do a second call to present some data after the
error occurs. This second call seem to always result in error
-2147164157 Method '~' of object '~' failed.

Any help would be greatly appreciated!
Thanks

Here is the general layout:

<%@LANGUAGE="VBSCRIPT" TRANSACTION=REQUIRED%>
<%
option explicit
response.expires=0
%>
<%

On Error Resume Next

Set oBLL = server.createobject("FabBLL.Fields")
Set oBLLUnit = server.createobject("FabBLL.Units")

oBLL.Update

if (Err.number <> 0) then
strScreenError = Err.Description ' Used to display popup on
clientside
Err.Clear
ObjectContext.SetAbort
end if

%>

' additional html code

<%
Set oRSUnit = oBLLUnit.GetAll()

If Err.number <> 0 then
Response.Write Err.Number & Err.Description
Err.Clear
Else
' Code here to generate <Select> tags for user choice
' need to run even if update above throws an error
' problem is that whenever update throws an error the Getall()
call
' above always throws an error -2147164157
End If

Cowboy (Gregory A. Beamer)
10/13/2003 1:27:56 PM
You are attempting to use an object that has already been set to SetComplete
or SetAbort. At least that is the most likely cause. The object then is
destroyed and falls out of scope. Since you are using two different
transactions, it is best to let COM+ handle the instantiation and pooling
and act as if the whole process, on second hit, was identical to the first
hit.

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

**********************************************************************
Think Outside the Box!
**********************************************************************
[quoted text, click to view]

jegs313 NO[at]SPAM hotmail.com
10/14/2003 7:48:03 PM
Sorry I'm not understanding something. I'm not intending on having
two transactions. The two com+ objects created are marked as requires
transaction not requires new transaction. I thought that they both
would be enlisted in the page's transaction invoked by the
@transaction directive. It is once I get an error on the first object
I do one call on the 2nd object (which results in the error
-2147164157). At that point the 2nd object hadn't been used for a
call yet. So I'm confused how it could have had setcomplete or abort
called to allow it to drop out of scope.

Thanks

[quoted text, click to view]
AddThis Social Bookmark Button