On 04/06/07, Jonas Alves <[EMAIL PROTECTED]> wrote:
On 04/06/07, Carl Franks <[EMAIL PROTECTED]> wrote:
>
> It was originally posted to the html-widget list by Jonas Alves.
> I didn't add it to svn, but didn't get round to replying to explain
> why - my bad!
>
> Unless both the form processing and any subsequent use of the form
> input, are wrapped within a DB transaction - then the uniqueness check
> is rather useless.

Hi Carl,
Can you please explain why is it useless? I'm using this approach in production
and I'm satisfied with it.

Ok, 'useless' was a rather emotive word, but I would say it's not a
good way to do it.

The word 'transaction' should have been enough of a clue as to what's
wrong with it.

If your database of choice doesn't support transactions, then you'll
need to use a unique index on the appropriate column, and just check
for errors when you attempt the insert.

It is something that i check a lot before a form submit so it's handy
to have it in a constraint for reusability.

I agree it's handy, but in this case that's conflicting with "working
correctly".
Your choice ;)

Carl

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to