I am new to jboss and j2ee and have a design question to pose to you all and how you would solve it.
Here is a simple example. Lets say I have an ordering system, every time an order is placed a special order number we manage must be incremented sequentially. No two threads can manipulate the order number (increment it) at the same time. This order number is very particular to the type of thing being ordered and it is not a simple number but an alphanumeric string.
On top of this we have several load-balanaced application servers all that have the code to increment this order number. So basically my question boils down to distributed synchronization of the execution of this method. How do you prevent simultanious access to a block of code in a distributed load balanced environment?
How would you do this in J2ee design? Stateless session beans? what about in a clustered environment with jboss? Can you have single threaded access to code in EJB's or a j2ee setup?