transaction to update a vector

Discussion in 'Java' started by mark, Jul 6, 2005.

  1. mark

    mark Guest

    hi, i am implementing a train system using sockets. each train (client)
    connects to the centre control centre (server) and sends a string message
    which is a request to move to the next section of track. i need to include
    transactions because i aim to measure the performance of these transactions
    when implemented using various AOP techniques.

    each client connecting to the server gets its own thread. within the thread
    is a method to move which involves looking up a vector element to check it
    is not occupied by another train. this method needs to be a transaction so
    two trains cannot access the same resource and both read the next section as
    empty thus causing a crash.

    can i make this method transactional when the resource is a vector within a
    class. i have struggled to get a context value.
    should the context value reference the class/vector.
    UserTransaction ut = context.getUserTransaction();ut.begin....thanks, mark
    mark, Jul 6, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pmatos
    Replies:
    6
    Views:
    23,790
  2. Replies:
    8
    Views:
    1,915
    Csaba
    Feb 18, 2006
  3. Javier
    Replies:
    2
    Views:
    561
    James Kanze
    Sep 4, 2007
  4. Vencz Istv?n
    Replies:
    2
    Views:
    286
  5. Rushikesh Joshi
    Replies:
    0
    Views:
    359
    Rushikesh Joshi
    Jul 10, 2004
Loading...

Share This Page