aspose file tools*
The moose likes Java in General and the fly likes Suggestion - Block an item to an user (e.g. onunload, lock of table) show the message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Suggestion - Block an item to an user (e.g. onunload, lock of table) show the message "Item in use"" Watch "Suggestion - Block an item to an user (e.g. onunload, lock of table) show the message "Item in use"" New topic
Author

Suggestion - Block an item to an user (e.g. onunload, lock of table) show the message "Item in use"

André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
Hey guys!

I need so much of your help, let me detail the work that I have to do:

There is an user screen (use case) that has many different use cases that are shown there (sub use cases) such as Refuse Quotation, Formalize Quotation and Print Quotation, however
is not permitted two or more than two users accessing the Quotation in the same time... How could you do this? A guy said to us the following possibility: When an user selects an item as Refuse Quotation, behind that item there is a link that invokes the method named isBlock, a type of boolean, in case that still not blocked it will invoke the method named insertBlock
and after that operation when the user will go out of the application will be called the method deleteBlock. Unfortunately there are small kind of bugs present because in real world the user can go out of the applicatoin by clicking on back botton or clicking on close window from the brownser and this way that blocked fuction/user screen will keep blocked because the method deleteBlock will not invoke when the user click on back botton or close window that action works only when the user click on ok button. We heard about the onunload event from Java Script and lock of table as a solution but it must be thinked with more dateil for avoid some problems.

Thanks for your attention!

take care,
André AS

Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

I would not use javascript to lock and unlock access because it can be turned off or even manipulated. So do it server-side. A simple solution would be implementing a timeout.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
hmmm... lock of table, right?

thank you,
André AS
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
The scenery is:

Struts 1
EJB 2
and JDBC is a layer of persistence

What would you say based on it?

bye,
André AS
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
A guys said to me something like Lister from Servlet...

bye,
André AS
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
May be is better utilize a code server-side, right?

bye,
André AS
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

First of all PatienceIsAVirtue. There is no need to bump it up within 24 hours. Like I said before a server-side solution would be the best solution. There are 2001 possible solutions for the problem you have. Why don't you try one and if you run into problems then we will be more then happy to help you.
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
Set a Timeout where locked table you mean?

thank you very much for your attention!

André AS
 
Don't get me started about those stupid light bulbs.
 
subject: Suggestion - Block an item to an user (e.g. onunload, lock of table) show the message "Item in use"