Ask a Question related to ASP Components, Design and Development.
-
G Smith #1
@transaction=required - results in hang after error thrown
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
%>
G Smith Guest
-
Restart MySQL and Error is thrown... all ok afterrefresh
Hello Folks, I have a variety of sites on my server all accessing the MySQL database. Whenever I restart MySQL and attempt to access one of the... -
error A License Exception has been thrown
:D I have been experiencing the same License Exception problem myself, with a new installation of Coldfusion 6.1. Enterprise Edition. As... -
No error message on manually thrown exceptions
Why, if I throw a System.Exception in my web method, do I see the standard IE 500 error page, rather than the stack trace as I do with other errors... -
Transaction Error
Hi, I am working on ASP 3.0 with MS SQL 2000. We have an online registration form where in once the information is submitted (along with credit... -
Why is there no error thrown in these 3 lines of code?
$MyVar=1; if (MyVar ==1){ $var2="abc"; } Notice I left out the "$" in the IF statement. No error. It drops into the statement and sets the... -
Cowboy \(Gregory A. Beamer\) #2
Re: @transaction=required - results in hang after error thrown
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!
************************************************** ********************
"G Smith" <jegs313@hotmail.com> wrote in message
news:a8bbc7a5.0310090521.616a23f6@posting.google.c om...> 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\) Guest
-
G Smith #3
Re: @transaction=required - results in hang after error thrown
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
"Cowboy \(Gregory A. Beamer\)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in message news:<uEQzzfbkDHA.2424@TK2MSFTNGP10.phx.gbl>...> 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!
> ************************************************** ********************
> "G Smith" <jegs313@hotmail.com> wrote in message
> news:a8bbc7a5.0310090521.616a23f6@posting.google.c om...> > 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
> >
> > %>G Smith Guest



Reply With Quote

