Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User - Controller - Unique usernames/emails #13

Open
GoogleCodeExporter opened this issue Mar 13, 2015 · 3 comments
Open

User - Controller - Unique usernames/emails #13

GoogleCodeExporter opened this issue Mar 13, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Trying to register a new user with the same username or email as an
existing one currently throws an exception. It shouldn't.

I don't really know how to solve this. But I guess there are two ways: 

1. Catch the exception and parse it for clues as to why something went
wrong. If it was due to a "Integrity Contstraint Violation", the username
or email wasn't unique.

More: http://java.sun.com/javase/7/docs/api/

2. Somehow do it as a transaction, first selecting any users with the same
username or email, and if the selection is empty, insert. But what if the
entire transaction fails, either due to someone else doing stuff, or
because of bad sql?

More: http://java.sun.com/docs/books/tutorial/jdbc/basics/transactions.html

Original issue reported on code.google.com by tgwizard on 9 Apr 2010 at 5:36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant