We have now “paused” the data we were previously using and have replaced it with the
data from the Test data pod bookmark.
In this scene, we are going validate the presence of the bug, and work to source the root cause of the issue.
YOUR STEPS FOR THIS SCENE:
- Open
Patients Devin a new tab. Login, and go to the Users section. You should now see we have replicated the “broken test” environment. - Notice the duplicate
mcredusername. This is the exact state of the bookmarked data in ourTestdata pod.
- Let’s delete the duplicate
mcreduser. Click the X icon next to one of themcredusernames - Click OK on the dialog box

- The application is now down to three users

- Let’s manually add a user to test the bug ourselves. Click the
+icon to open theAdd Userform - Create a user with the username
mcred. You can put any values you want into the other fields. Click Save
- You should now see your user in the list. Once you verified the user, repeat steps 2 & 3 to delete the user.

- It is pretty obvious that the issue is we do not have a unique constraint on our username field.
Let’s patch this defect by applying a unique constraint to the username column of the USERS table in our database.
The following sql code should do it:
ALTER TABLE USERS ADD CONSTRAINT username UNIQUE(username); - Let’s manually apply this to our Dev environent to see if it has the desired effect. Open a terminal window.
- SSH into the Development database server as the
centosuserssh centos@devdb - Change to the
oracleuser.sudo su - oracle - Connect to the
devdbvia sqlplussqlplus delphixdb/delphixdb@devdb:1521/devdb - Copy and paste the sql code from step 10 into the terminal window and press enter.
You should see a message that says
Table altered.
- Now let’s go to our Dev App and test the fix. Repeat steps 6 & 7 above.
- This time, you should notice that the application won’t allow us to add a duplicate user. In a real use case, we would update the application code to also return an error message, but that is beyond the scope of this workshop.
- Change the username to something unique and click save to validate that our add user form is still working.
- Great. Now let’s submit the patch.