Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Unanswered: Transaction/Concurrency Control

    Hello,
    I am doing a project for a University course in db2 (in Embedded SQL) where we have to implement a simple drug store system, but we must add concurrency control so that multiple transactions can run at the same time without conflicting with each other.
    I know how to implement this using 2-phase locking, but I would like to try out the timestamping model as it would be a little bit more challenging.
    Can anyone tell me if db2 has timestamping model built in and if so some examples of how to use it, or where I can find documentation on it?
    I have implemented my own simple implementation of timestamping simply comparing timestamps with 'if' statement but am not happy with this.

    Thanks

    rleibold

  2. #2
    Join Date
    Mar 2004
    Posts
    4

    Re: Transaction/Concurrency Control

    Sorry, I fogot. We're using UNIX, but I am not sure what the version of either unix or db2 are.

  3. #3
    Join Date
    Jan 2004
    Location
    Egypt
    Posts
    61

    Re: Transaction/Concurrency Control

    Originally posted by rleibold
    Hello,
    I am doing a project for a University course in db2 (in Embedded SQL) where we have to implement a simple drug store system, but we must add concurrency control so that multiple transactions can run at the same time without conflicting with each other.
    I know how to implement this using 2-phase locking, but I would like to try out the timestamping model as it would be a little bit more challenging.
    Can anyone tell me if db2 has timestamping model built in and if so some examples of how to use it, or where I can find documentation on it?
    I have implemented my own simple implementation of timestamping simply comparing timestamps with 'if' statement but am not happy with this.

    Thanks

    rleibold
    hi,

    i wanna understand what u mean by concurrency control ?
    does it mean than u wanna many transaction to insert into same table ?
    or many transaction access(read/update) same data in the table ?
    or u wanna to avoid dead lock in DB2 ?
    or u wanna many transacton to be done from multi-threwaded embeded SQL code in C ?

    just let me know, had go throught all of that before
    hany heggy,
    IBM certified Professional, AIX system support
    www.melodyhits.tv

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: Transaction/Concurrency Control

    Originally posted by rleibold

    Can anyone tell me if db2 has timestamping model built in and if so some examples of how to use it, or where I can find documentation on it?
    The answer is "no". You'll have to have that kind of transaction control within your application.

  5. #5
    Join Date
    Mar 2004
    Posts
    4

    Re: Transaction/Concurrency Control

    Originally posted by hanyheggy
    hi,

    i wanna understand what u mean by concurrency control ?
    does it mean than u wanna many transaction to insert into same table ?
    or many transaction access(read/update) same data in the table ?
    or u wanna to avoid dead lock in DB2 ?
    or u wanna many transacton to be done from multi-threwaded embeded SQL code in C ?

    just let me know, had go throught all of that before
    Basically there will be multiple transactions all reading/updating at the same time. The timestamp model should automatically avoid deadlocks (if implemented properly) as well as concurrency problems like uncommited reads, phantom reads, etc.
    The system will have 2+ processes (embedded C) running at the same time each with transactions running according to what the user specifies from the UI.

    I just need to know if there are any db2 functions in db which will take care of this timestamping.

Posting Permissions

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