@transaction=required - results in hang after error thrown

Ask a Question related to ASP Components, Design and Development.

  1. #1

    Default @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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139