transaction to update a vector

M

mark

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top