2009/9/12 Thiago H. de Paula Figueiredo <thiag...@gmail.com>: > Em Sat, 12 Sep 2009 17:38:43 -0300, Bruno Santos <bitbet...@gmail.com> > escreveu: > >> Well, even if i do: >> >> league = new League(); >> league.setName("repeated name"); > > Unique constraints like this should be checked by you *before* sending an > insert or update to the database.
Would that not simply create a race condition? Thread A checks XYZ, thread B (checks and) writes XYZ, thread A tries to write XYZ and BOOM. Shouldn't database constraint checking be a job for the database, not for the application? The right tool for the job and all that. :-) (That doesn't mean you can't check prior to inserting/updating but you should never *rely* on it.) --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org