The aim is to ensure that if two customers attempt to book a seat on the same flight concurrently, then the number of available seats is definitely reduced by two, unless there was only one seat, in which case, one customer will be advised at booking time that no more seats are available.
The integer argument indicates the record to be locked. If the method is called with an argument of -1, the entire database should be locked.
Does that means if there are three seats available,
I should let three clients book at the same time or I should let them one by one?
What does the INTEGER ARGUMENT mean?
Is it the seats the client wants to book?
Could I copy and paste the codes from Data.java to the implemention class in the RemoteAccess.java and not use Data.java?Or must I
use it in the both local and remote?
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
It's the record number.
In server,I have three classes(RemoteAccess,FactoryConnection,DBServer).
DBServer use the Naming.rebind("Factory",f) and f is the object of the FactoryConnection(extends UnicastRemoteObject) which returns the object of the RemoteAccess(extends UnicastRemoteObject).
Sorry,I still wonder what is the record number?
Is <1> or <2> right?
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
To connect with your server, you should create a client program. This implementation should include a class that implements the same public methods as the suncertify.db.Data class, although it will need different constructors to allow it to support the network configuration.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
scwcd, scjd, scjp<br /><a href="http://natejohnson.us" target="_blank" rel="nofollow">http://natejohnson.us</a><br /><a href="http://rice.kuali.org" target="_blank" rel="nofollow">http://rice.kuali.org</a>
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
You can implement them all in your implementation classes, the ones that implement the public Data interface.
How about the LockManager.class like others?
I think it's a good idea.
And do I have to deal with the dead client?
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |