DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Newbie question : How to handle transaction ?

  1. #1
    SI SOL Guest

    Newbie question : How to handle transaction ?


    Hello,

    I'm completely new to 3 tier world. I have a plan to write 3 tier application.
    The midle tier will have single connection to database server, and all the
    client will share those database connection. The thing that make me confused
    is that in all of my experience (in 2 tier world), COMMIT or ROLLBACK will
    affect on all client which have the same database connection. With just a
    single database connection in the midle tier, how can I handle client transactions
    (client A issue a COMMIT, client B issue a ROLLBACK, and the other is still
    updating ) ?

    Thank in advance

    SI SOL

  2. #2
    ranga raghunathan Guest

    Re: Newbie question : How to handle transaction ?


    hello
    you are incorrect in assuming that there is only one single connection that
    is shared by all clients .. each client will instatiate a business object
    in the middle tier which in turn will create a connection object to the database
    .. so if there are 100 clients, then there will be several connection objects
    to the database -- i say several and not 100 because the concept of connection
    pooling will ensure that connection objects are recycled if possible and
    only created when necessary.

    in 3-tier development, it is not necesary to write rollback and commit in
    stored procedures anymore .. just mark your components as transactional and
    the dtc in your middle tier server will communicate with the dtc in your
    sql server to complete the transaction (or rollback) for you

    regards
    ranga
    "SI SOL" <SI_SOL@MAIL.COM> wrote:
    >
    >Hello,
    >
    >I'm completely new to 3 tier world. I have a plan to write 3 tier application.
    >The midle tier will have single connection to database server, and all the
    >client will share those database connection. The thing that make me confused
    >is that in all of my experience (in 2 tier world), COMMIT or ROLLBACK will
    >affect on all client which have the same database connection. With just

    a
    >single database connection in the midle tier, how can I handle client transactions
    >(client A issue a COMMIT, client B issue a ROLLBACK, and the other is still
    >updating ) ?
    >
    >Thank in advance
    >
    >SI SOL



  3. #3
    Thomas Eyde Guest

    Re: Newbie question : How to handle transaction ?

    That requires the database server to support the dts, MS Sql Server does it
    of course, but not all.

    --
    /Thomas
    thomas.eyde@eunet.no


    ranga raghunathan <ranga1@msn.com> wrote in message
    news:3987608d$1@news.devx.com...

    > in 3-tier development, it is not necesary to write rollback and commit in
    > stored procedures anymore .. just mark your components as transactional

    and
    > the dtc in your middle tier server will communicate with the dtc in your
    > sql server to complete the transaction (or rollback) for you





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center