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
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