2 db connection on 1 asp page. DB transaction

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hien Nguyen
    New Member
    • Jun 2018
    • 1

    2 db connection on 1 asp page. DB transaction

    Hi all,

    Now I have problem when make a asp page.

    I use 2 db connection connect to 2 db differrent

    And then have some query execute on db1, some query execute on db2.

    Begintrans

    If true -> Commit

    else -> Rollback

    But this case, db1/db2 still insert records.

    Thanks for all!

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

    db1.execute

    db2.execute

    if use - stock <=0 then

    message -> out of stock

    history.back()

    response.end

    end if

    if err.count <> 0

    db1.commitTrans

    db2.commitTrans

    else

    db1.RollbackTra ns

    db2.RollbackTra ns

    enf if
Working...