Re: con-current access
shailesh dhawla <[email protected]> Mon, 1 Apr 2002 21:19:41 -0800 (PST)
| Newsgroups | gmane.comp.java.ejb.general |
|---|---|
| Message-ID | <[email protected]> |
hi i dont think this is concurrent access problem. basically both the operations you have mentioned fall in different transaction boundaries. also, such issues can be resolved at the database table level and using stored procs with some validations. here you have not mentioned the table details. anyhow what can be done is after the manager assigns it to another employee2, and the employee1 accepts the work ..this request should hit the databse and can do some validation..if the work is not assigned to employee1..a message can be sent to the employee1 informing that it doesn't belong to him anymore etc... dshail --- tadta <[email protected]> wrote: > Hello, > > please give suggestions... > > > We are using application server with jsp and > servlets in our > application. We use connection pooling > > In code we have the problem like > we have following tables > manager,employee,workAllocated > The manager allocates the work to the employee.The > work allocated is > stored in workAllocated table. The employee replies > back as to > whether he accepts the work or wants a change in > work > allocated to him. The manager can at any time change > the work > allocated to employees. > Now the problem is this. Manager assigns work to > employee1. employee1 > opens the browser and is about to click the button > 'accept work' at > that time the manager assigns the work of employee1 > to another > employee. The employee1 clicks the 'accept work' > button. Here we are > directly updating the status as 1 in database > indicating that > employee1 has accepted the work whereas the manager > has assigned the > work to another employee. > > What is this problem called is this con-current > access problem > We have written code in jsp. So we have to take care > of this problem > by coding how to do that in jsp any idea? > Or is it advisable to use EJB. What are points in > favour with regard > to this problem alone to shift to EJB. How does EJB > solve this > problem better than doing doing ourself by code. > > regards > Javid > > > __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://http://taxes.yahoo.com/