Professional Web Applications Themes

Transaction Error - ASP Database

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 card info.) the information is taken on another asp page where i have set the page level transaction (transaction = required) on. Once the information is verified on this page and if everything is fine then internally another page is called where the information is stored into the database. Now i have put the error handling part in the second page where information is verified in which i have made it that when ...

  1. #1

    Default 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 card info.) the information
    is taken on another asp page where i have set the page
    level transaction (transaction = required) on.
    Once the information is verified on this page and if
    everything is fine then internally another page is called
    where the information is stored into the database.
    Now i have put the error handling part in the second page
    where information is verified in which i have made it that
    when an error comes then the transaction should be rolled
    back (ObjectContext.SetAbort) and then the error number
    (Err.Number) and the error description(Err.Description)
    is emailed at my address. I just put this error handling
    part few days back and now not always but at times i do
    get Email which has the error number and error description
    as follows

    --------------------------------------------------------

    -2147217900 [Microsoft][ODBC SQL Server Driver][SQL
    Server]Distributed transaction completed. Either enlist
    this session in a new transaction or the NULL transaction.

    --------------------------------------------------------

    I tried searching for this error but couldn't find the
    exact reason and solution for the same.
    So if any one has and idea about this and the exact
    solutino to it or some url where i can go and see the
    solution then please let me know.

    Thank you
    Niel Guest

  2. #2

    Default Re: Transaction Error

    You might be able to get a better response if you posted your code.
    If possible, strip it down to the bare minimum of code that still exhibits
    your problem.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "Niel" <nandip2k4vippowernet.com> wrote in message
    news:uVi$gBvzDHA.3196TK2MSFTNGP11.phx.gbl...
    > I haven't got any solution or answers from anyone. This is really urgent.
    If
    > anyone has an idea on this please let me know.
    > Any help would be appreciated.
    >
    > Thank you
    >
    >
    > "Niel" <winowahotmail.com> wrote in message
    > news:010701c3ce33$6251ae40$a301280aphx.gbl...
    > > 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 card info.) the information
    > > is taken on another asp page where i have set the page
    > > level transaction (transaction = required) on.
    > > Once the information is verified on this page and if
    > > everything is fine then internally another page is called
    > > where the information is stored into the database.
    > > Now i have put the error handling part in the second page
    > > where information is verified in which i have made it that
    > > when an error comes then the transaction should be rolled
    > > back (ObjectContext.SetAbort) and then the error number
    > > (Err.Number) and the error description(Err.Description)
    > > is emailed at my address. I just put this error handling
    > > part few days back and now not always but at times i do
    > > get Email which has the error number and error description
    > > as follows
    > >
    > > --------------------------------------------------------
    > >
    > > -2147217900 [Microsoft][ODBC SQL Server Driver][SQL
    > > Server]Distributed transaction completed. Either enlist
    > > this session in a new transaction or the NULL transaction.
    > >
    > > --------------------------------------------------------
    > >
    > > I tried searching for this error but couldn't find the
    > > exact reason and solution for the same.
    > > So if any one has and idea about this and the exact
    > > solutino to it or some url where i can go and see the
    > > solution then please let me know.
    > >
    > > Thank you
    >
    >

    Mark Schupp Guest

  3. #3

    Default Re: Transaction Error

    I haven't got any solution or answers from anyone. This is really urgent. If
    anyone has an idea on this please let me know.
    Any help would be appreciated.

    Thank you


    "Niel" <winowahotmail.com> wrote in message
    news:010701c3ce33$6251ae40$a301280aphx.gbl...
    > 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 card info.) the information
    > is taken on another asp page where i have set the page
    > level transaction (transaction = required) on.
    > Once the information is verified on this page and if
    > everything is fine then internally another page is called
    > where the information is stored into the database.
    > Now i have put the error handling part in the second page
    > where information is verified in which i have made it that
    > when an error comes then the transaction should be rolled
    > back (ObjectContext.SetAbort) and then the error number
    > (Err.Number) and the error description(Err.Description)
    > is emailed at my address. I just put this error handling
    > part few days back and now not always but at times i do
    > get Email which has the error number and error description
    > as follows
    >
    > --------------------------------------------------------
    >
    > -2147217900 [Microsoft][ODBC SQL Server Driver][SQL
    > Server]Distributed transaction completed. Either enlist
    > this session in a new transaction or the NULL transaction.
    >
    > --------------------------------------------------------
    >
    > I tried searching for this error but couldn't find the
    > exact reason and solution for the same.
    > So if any one has and idea about this and the exact
    > solutino to it or some url where i can go and see the
    > solution then please let me know.
    >
    > Thank you

    Niel Guest

  4. #4

    Default Re: Transaction Error

    1) This is what I have set on the top of the asp page

    <% Language=VBScript transaction=required %>
    On Error Resume Next

    2) next I process the info. Like first get the information form previous
    page like
    Firstname = request.form("firstname")
    Lastname = request.form("lastname")
    And so on.. And once I have all that information (which also has the
    customer credit card inforomation then it is taken to transaction processing
    company for charging and once that is done I get a reply as 1,2 or 3
    1 as in success, 2 as in decline(lack of funds) and 3 as in decline(due to
    some other error).
    If the reply is 1 then I redirect the user to final page where in insert the
    information in database.
    In rest of replies I just display the Error message to user.

    3) After all this at the last on this page I have set the error handling
    part which is as follows


    if Err.number <> 0 then

    ObjectContext.SetAbort

    errorDesc = Err.Description
    errorNo = Err.number

    call sendErrorInEmail(errorNo,errorDesc)

    end if


    sub sendErrorInEmail(ENo,EDesc)

    ErrorMsg = "<font color=black size=1 face=verdana><b>" & ENo &
    "</b>&nbsp;&nbsp;" & EDesc & "</font>"

    set errorMail = server.CreateObject("CDONTS.Newmail")

    errorMail.From = "Admindomain.com"
    errorMail.To = "supportdomain.com"
    errorMail.Subject = "Error while Registering user for company"
    errorMail.BodyFormat = 0
    errorMail.MailFormat = 0
    errorMail.Body = ErrorMsg

    errorMail.Send

    set errorMail = nothing

    Response.Clear
    Response.Write "<font color=darkblue size=1 face=verdana>There was an error
    while processing your request.</font><br><br>"
    Response.Write "<input type=button name=btnBck value='Back'
    onclick=javascript:history.back()'>"
    Response.End

    end sub


    4) And following is what the error message I get

    -2147217900 [Microsoft][ODBC SQL Server Driver][SQL Server]Distributed
    transaction completed. Either enlist this session in a new transaction or
    the NULL transaction.



    Hope this will help
    Thank you


    "Niel" <winowahotmail.com> wrote in message
    news:010701c3ce33$6251ae40$a301280aphx.gbl...
    > 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 card info.) the information
    > is taken on another asp page where i have set the page
    > level transaction (transaction = required) on.
    > Once the information is verified on this page and if
    > everything is fine then internally another page is called
    > where the information is stored into the database.
    > Now i have put the error handling part in the second page
    > where information is verified in which i have made it that
    > when an error comes then the transaction should be rolled
    > back (ObjectContext.SetAbort) and then the error number
    > (Err.Number) and the error description(Err.Description)
    > is emailed at my address. I just put this error handling
    > part few days back and now not always but at times i do
    > get Email which has the error number and error description
    > as follows
    >
    > --------------------------------------------------------
    >
    > -2147217900 [Microsoft][ODBC SQL Server Driver][SQL
    > Server]Distributed transaction completed. Either enlist
    > this session in a new transaction or the NULL transaction.
    >
    > --------------------------------------------------------
    >
    > I tried searching for this error but couldn't find the
    > exact reason and solution for the same.
    > So if any one has and idea about this and the exact
    > solutino to it or some url where i can go and see the
    > solution then please let me know.
    >
    > Thank you

    Niel Guest

  5. #5

    Default Re: Transaction Error

    Niel wrote:
    > Hi,
    > does any knows the solution for the problem that i have described.
    > Please let me know if any one has any idea about what should be done
    > to avoid this.
    Sorry, I've never done transaction processing in my vbscript code: I've
    always encapsulated my transactions in stored procedures. In fact, that is
    my suggestion: put the entire process into a stored procedure, including the
    email part (you can use the builtin SQLMail, or, if you prefer to use smtp
    rather than mapi, install Gert Draper's XP_SMTP_SendMail (from
    [url]http://www.sqldev.net/xp/xpsmtp.htm[/url]). see
    [url]http://www.aspfaq.com/show.asp?id=2403[/url])

    HTH,
    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

  6. #6

    Default Re: Transaction Error

    "Bob Barrows" <reb01501NOyahoo.SPAMcom> wrote in message
    news:%23XWC$XV0DHA.2116TK2MSFTNGP11.phx.gbl...
    > Niel wrote:
    > > Hi,
    > > does any knows the solution for the problem that i have described.
    > > Please let me know if any one has any idea about what should be done
    > > to avoid this.
    >
    > Sorry, I've never done transaction processing in my vbscript code:
    I've
    > always encapsulated my transactions in stored procedures. In fact,
    that is
    > my suggestion: put the entire process into a stored procedure,
    including the
    > email part (you can use the builtin SQLMail, or, if you prefer to use
    smtp
    > rather than mapi, install Gert Draper's XP_SMTP_SendMail (from
    > [url]http://www.sqldev.net/xp/xpsmtp.htm[/url]). see
    > [url]http://www.aspfaq.com/show.asp?id=2403[/url])
    To expand Bob's recommendation, I'd like to add that it is not advisable
    to mix SQL Server transaction management with DTS/COM+ transaction
    management. If the scope of your transactional logic is limited to SQL
    Server then that's were the transaction management should occur. If the
    scope goes beyond SQL Server, then use DTS/COM+ and make sure there are
    no transaction calls in your stored procedure (this includes any sql
    statements that would invoke triggers with transactional logic). You can
    use RAISE ERROR/RETURN in your stored procedure to communicate status
    back to DTS/COM+. In the rare case where your stored procedure needs to
    be run in both a DTS/COM+ context and stand alone, you can use
    TRANCOUNT to determine context and control the flow of your stored
    procedure accordingly. However, I would strongly urge you to against
    this approach except as a last resort. A stored procedure should either
    be a discreet transaction onto itself or a "component" of a large
    transaction, not both.


    I realize there's a lot of "hand waving" in the above, but it's as
    detailed as I could be absent the following:
    1. The actual code for the stored procedure
    2. OS Version
    3. DTS Version
    4. MDAC Version

    Finally, here's a KB article on the error you are encountering which
    discusses other possible causes.

    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;191168[/url]

    HTH
    -Chris Hohmann


    Chris Hohmann Guest

  7. #7

    Default Re: Transaction Error

    "Chris Hohmann" <nospamthankyou.com> wrote in message
    news:Oq4Ol1W0DHA.2528TK2MSFTNGP09.phx.gbl...
    > A stored procedure should either be a discreet transaction onto itself
    or a "component" of a large transaction, not both.

    That should read "... of a LARGER transaction..."


    Chris Hohmann Guest

  8. #8

    Default Re: Transaction Error

    Hi,
    does any knows the solution for the problem that i have described.
    Please let me know if any one has any idea about what should be done to
    avoid this.

    Thank you

    "Niel" <nandip2k4vippowernet.com> wrote in message
    news:u$u6Ly#zDHA.1524TK2MSFTNGP10.phx.gbl...
    > 1) This is what I have set on the top of the asp page
    >
    > <% Language=VBScript transaction=required %>
    > On Error Resume Next
    >
    > 2) next I process the info. Like first get the information form previous
    > page like
    > Firstname = request.form("firstname")
    > Lastname = request.form("lastname")
    > And so on.. And once I have all that information (which also has the
    > customer credit card inforomation then it is taken to transaction
    processing
    > company for charging and once that is done I get a reply as 1,2 or 3
    > 1 as in success, 2 as in decline(lack of funds) and 3 as in decline(due
    to
    > some other error).
    > If the reply is 1 then I redirect the user to final page where in insert
    the
    > information in database.
    > In rest of replies I just display the Error message to user.
    >
    > 3) After all this at the last on this page I have set the error handling
    > part which is as follows
    >
    >
    > if Err.number <> 0 then
    >
    > ObjectContext.SetAbort
    >
    > errorDesc = Err.Description
    > errorNo = Err.number
    >
    > call sendErrorInEmail(errorNo,errorDesc)
    >
    > end if
    >
    >
    > sub sendErrorInEmail(ENo,EDesc)
    >
    > ErrorMsg = "<font color=black size=1 face=verdana><b>" & ENo &
    > "</b>&nbsp;&nbsp;" & EDesc & "</font>"
    >
    > set errorMail = server.CreateObject("CDONTS.Newmail")
    >
    > errorMail.From = "Admindomain.com"
    > errorMail.To = "supportdomain.com"
    > errorMail.Subject = "Error while Registering user for company"
    > errorMail.BodyFormat = 0
    > errorMail.MailFormat = 0
    > errorMail.Body = ErrorMsg
    >
    > errorMail.Send
    >
    > set errorMail = nothing
    >
    > Response.Clear
    > Response.Write "<font color=darkblue size=1 face=verdana>There was an
    error
    > while processing your request.</font><br><br>"
    > Response.Write "<input type=button name=btnBck value='Back'
    > onclick=javascript:history.back()'>"
    > Response.End
    >
    > end sub
    >
    >
    > 4) And following is what the error message I get
    >
    > -2147217900 [Microsoft][ODBC SQL Server Driver][SQL Server]Distributed
    > transaction completed. Either enlist this session in a new transaction or
    > the NULL transaction.
    >
    >
    >
    > Hope this will help
    > Thank you
    >
    >
    > "Niel" <winowahotmail.com> wrote in message
    > news:010701c3ce33$6251ae40$a301280aphx.gbl...
    > > 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 card info.) the information
    > > is taken on another asp page where i have set the page
    > > level transaction (transaction = required) on.
    > > Once the information is verified on this page and if
    > > everything is fine then internally another page is called
    > > where the information is stored into the database.
    > > Now i have put the error handling part in the second page
    > > where information is verified in which i have made it that
    > > when an error comes then the transaction should be rolled
    > > back (ObjectContext.SetAbort) and then the error number
    > > (Err.Number) and the error description(Err.Description)
    > > is emailed at my address. I just put this error handling
    > > part few days back and now not always but at times i do
    > > get Email which has the error number and error description
    > > as follows
    > >
    > > --------------------------------------------------------
    > >
    > > -2147217900 [Microsoft][ODBC SQL Server Driver][SQL
    > > Server]Distributed transaction completed. Either enlist
    > > this session in a new transaction or the NULL transaction.
    > >
    > > --------------------------------------------------------
    > >
    > > I tried searching for this error but couldn't find the
    > > exact reason and solution for the same.
    > > So if any one has and idea about this and the exact
    > > solutino to it or some url where i can go and see the
    > > solution then please let me know.
    > >
    > > Thank you
    >
    >

    Niel Guest

Similar Threads

  1. Replies: 5
    Last Post: March 5th, 09:50 AM
  2. Replies: 1
    Last Post: April 5th, 10:55 AM
  3. Replies: 2
    Last Post: October 15th, 02:48 AM
  4. Distributed Transaction Error
    By dh kim in forum ASP Database
    Replies: 1
    Last Post: September 9th, 03:38 AM
  5. Error in Database Transaction
    By Vivek in forum ASP.NET General
    Replies: 0
    Last Post: July 8th, 09:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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