I do realize it takes additonal processor and time to do (an extra ten seconds, perhaps), but, assuming you're using a database which supports triggers, it really doesn't take long to have all of the maintenance associated with adding users and roles be automated. So far as changing username goes, I don't see why you couldn't. You would, of course, want to ensure everything stayed in sync, but triggers really are a useful tool for doing things such as this.

Username being a primary key demands that it be unique. Referrential integrity demands that, when used as a foreign key, the value of the field be the same as where it is the primary key. Neither of these two constraints demand that username be unchanging. Just allow updates to cascade when you create the table and you shouldn't have to contend with any RI issues.

Dan Allen wrote:

This is a simple one, pardon the request for advice.

In the specs for JDBCRealm it talks about a username column being in
the users table and in the user_role table.  Does this mean that the
username column has to be the primary key in the users table and not
a user_id??  I thought it was bad design to make a text field a
primary key since it means that it would have to be updated in two
places if the user changed usernames, or are we sticking with the
requirment that users can't change usernames or that it is an
uncommon task?

Dan


-- Eddie Bush





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to