Re: con-current access

"sudesh_1" <[email protected]> Tue, 02 Apr 2002 07:34:32 -0000
Newsgroups gmane.comp.java.ejb.general
Message-ID <[email protected]>
Hi 
I think your problem is that of a non repeatable read. That is a 
transaction reads a row and that row is changed by another 
transaction. When the first transaction reads that row again the data 
is changed. You should use JMS to notify the client of the changes. 
But as you are using browser as a client you cannot use JMS.

The only way out to me is to define your document as multi part MIME 
document. This way the scoket used to communicate to with the web 
server is  kept open until the document is finished.
 But for this you will have to use sevlet instead of  JSP pages as it 
will be easier to define all the needed aurguments as the document 
type.

Hope your problem is solved.

Sudesh.
--- In EJB-Developer@y..., "tadta" <mdjavid74@y...> 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