• Post Reply Bookmark Topic Watch Topic
  • New Topic

double click and prevent a user to be created twice  RSS feed

 
A. Aka
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

we have an application (1st application), on which you click on an url and a popup is opened(2nd application)
in the popup, we do create a user if he does not exist.
apparently sometimes clients do double click and because there are some integrity on the table, it throws an exception

normally the 1st application, is developed at client side , we do not have any control
the only thing we can do is change the 2nd application

I was hoping to solve this issue using synchronized or locking mechanism at hibernate level

1. what do you think about that ?
2. is it a good idea ? if not what do you propose ?
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the UI Level - Can you not disable the button, on the first click or another way is given here.
That said, you may still end up with duplicate requests on the server side. You may choose to pass a key (same key) to your server side component thereby detecting duplicate requests. You can also do action based restriction. If a user has done an operation at time X, then he cannot do the same until X+t seconds. Solutions differ based on your needs.

Also, do you have any business attributes which you can use to do a de-dup at the server side?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!