I am unable to design my seat booking method this a sample of my code id as follows but i am not satisfied with this code plz if any one have better idea how to design my seat booking method i will be very thankful. My Code: private void book(String f_seats){ try{ totalSeats=Integer.parseInt(label18.getText().trim()); if(totalSeats<=0){ prompt("Sorry !! no seats left","Message"); } else { seatsLeft=(totalSeats-(Integer.parseInt(f_seats))); String msg[]={label10.getText(), label11.getText(), label12.getText(), label13.getText(), label14.getText(), label15.getText(), label16.getText(), label17.getText(), String.valueOf(seatsLeft)}; intf.modify(new DataInfo(record, intf.getFieldInfo(), msg)); intf.unlock(record); prompt("Seats Booked","Message"); } } Plz Help me out Anurag Mishra
Mike Birken
Greenhorn
Joined: Dec 28, 2001
Posts: 20
posted
0
When do you lock intf? - Mike
Anurag Mishra
Ranch Hand
Joined: Sep 27, 2001
Posts: 133
posted
0
I lock in Booking Method private void booking(int rec){ intf.lock(rec); info=intf.getRecord(rec); ......Displays the record details on GUI and when number of seats are entered It calls the book method as stated earlier and unlocks record } The working is performed lik this lock-->read-->modify-->unlock Plz help me out Anurag Mishra