Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #333

Re: Preventing duplicate

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Lew" <lew@THRWHITE.remove-dii-this>
Subject Re: Preventing duplicate
Message-ID <r9idnRXamfAnWejYnZ2dnUVZ_u2dnZ2d@comcast.com> (permalink)
X-Comment-To comp.lang.java,comp.lang.
Newsgroups comp.lang.java.gui
In-Reply-To <ykA1h.9648$HY5.1983@trnddc06>
References <ykA1h.9648$HY5.1983@trnddc06>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 29
Date Wed, 27 Apr 2011 15:26:55 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303918015 96.60.20.240 (Wed, 27 Apr 2011 10:26:55 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:26:55 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:333

Show key headers only | View raw


  To: comp.lang.java,comp.lang.
(f-u set to clj.programmer)

Oleg Konovalov wrote:
> Hi,
> 
> I have a Java/JavaScript GUI application where I perform a lot of long DB 
> operations
> [e.g. massive SQL Insert's], which takes 5-60 secs to perform.
> Sometimes user double-clicks the button or just gets impatient and clicks 
> again,
> which created duplicate forcm submission and hence duplicate records.
> So I am trying to disable the button as soon as it is clicked, and as soon 
> as it's done,
> re-enable it again.

Trying to disable a browser control (back button, refresh) from the server is 
wrong and fraught with difficulty.

Make your transactions idempotent and stop trying to screw up people's browsers.

Another poster already referred you to the Token pattern. It is a solution.

- Lew

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | Next | Find similar


Thread

Re: Preventing duplicate "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000

csiph-web