@pawaitemadisoncollege Week 5 is ready for review.
As with week 4, I implemented the database relationships directly within the files of my project, which was likely why I encountered as many hiccups as I did (so many moving parts meant troubleshooting and debugging was much more wrinkly than I had expected).
What were your key learning points/takeaways?
This was a big learning week for me, so much so that it lasted more than a week :)
I began to attempt to implement the database mapping with my head firmly in SQL territory. This immediately sabotaged my efforts to set things up because I was not properly understanding the tools I was trying to use. Your comment about remembering the "O" in ORM was the key to changing up my thinking. Changing my perspective definitely was the key to being able to implement the pieces of the ORM model and tools.
I also learned that sometimes debugging won't be fruitful. Sometimes errors won't have a clear explanation, and the stack trace won't give any real actionable hints. Sometimes things will just fail, and then work, all for no apparent reason. I let these frustrations get to me; they blindsided me (I wasn't expecting to have utterly mysterious failures to work around), and I was feeling the pressure of getting behind where I should be in terms of class work (arguably a self-imposed pressure). Now I know that this can happen, and not every fail state or error will be something I can fix or make sense of.
Instead, I think I did the right thing by moving on and continuing to build other parts of the project, returning to the error with some productivity under my belt and a refreshed patience for the problem. I think I will be better prepared now to keep my cool and stave off frustration when I get into these situations again in the future.
What challenged you?
Whew... Can I just link the Week 5 page of the course web site? :D
Understanding the concepts on which the ORM model is built was a big challenge. I'm so comfortable with SQL and so used to interfaces like JDBC that it was hard for me to reset my perspective and think more abstractly about what was happening.
Finding guides to properly annotating the features I wanted to solve the problems I was encountering was a proper challenge. I did find some resources, but an equal amount of it was seeking out templates and emulating other structures I could find.
Getting unit tests constructed and running was yet another challenge. I think I might come back and build out a few more tests, but currently everything passes the tests I do have on the basic CRUD procedures.
What problems did you solve and what resources did you use to solve them?
I used lectures, videos, and notes a LOT this week. I reviewed the videos repeatedly, using sample code to build my starting points and then expanding it as best I could figure out to account for what I needed to do. I also made good use of the book I mentioned in my week 4 notes (Beginning Hibernate for Hibernate 5). I also used some web search results to help me resolve a few specific issues:
I also documented a handful of sites that I found when I was still looking for ways to overcome FK constraints, disable those constraints, or otherwise make Hibernate behave more like MySQL Workbench. I realize now that they were really not helping me; I was barking up the wrong tree, and apparently I was not alone. Others seem to have had the same kind of misunderstanding about Hibernate as I did, hence actually finding answers to questions that were posed from a place of missing knowledge.
This was a big week for learning how not to handle a stressful debugging session. I got to really test the limits of my debugging and troubleshooting abilities, and while it was a stress-fest, I do feel like I gleaned some good lessons for these situations in the future.
Great work implementing the generic dao and a TON of entities already. Wow!
[ ] It seems like the delete scenarios in one-to-many relationships could be tested more fully. For example, if a User is deleted, what should happen to their Owns or Views? What if a View is deleted? What happens to the User? Write tests to make sure whatever should happen, does happen from all "sides" of the relationship.
@pawaitemadisoncollege Week 5 is ready for review.
As with week 4, I implemented the database relationships directly within the files of my project, which was likely why I encountered as many hiccups as I did (so many moving parts meant troubleshooting and debugging was much more wrinkly than I had expected).
What were your key learning points/takeaways? This was a big learning week for me, so much so that it lasted more than a week :)
I began to attempt to implement the database mapping with my head firmly in SQL territory. This immediately sabotaged my efforts to set things up because I was not properly understanding the tools I was trying to use. Your comment about remembering the "O" in ORM was the key to changing up my thinking. Changing my perspective definitely was the key to being able to implement the pieces of the ORM model and tools.
I also learned that sometimes debugging won't be fruitful. Sometimes errors won't have a clear explanation, and the stack trace won't give any real actionable hints. Sometimes things will just fail, and then work, all for no apparent reason. I let these frustrations get to me; they blindsided me (I wasn't expecting to have utterly mysterious failures to work around), and I was feeling the pressure of getting behind where I should be in terms of class work (arguably a self-imposed pressure). Now I know that this can happen, and not every fail state or error will be something I can fix or make sense of.
Instead, I think I did the right thing by moving on and continuing to build other parts of the project, returning to the error with some productivity under my belt and a refreshed patience for the problem. I think I will be better prepared now to keep my cool and stave off frustration when I get into these situations again in the future.
What challenged you? Whew... Can I just link the Week 5 page of the course web site? :D
Understanding the concepts on which the ORM model is built was a big challenge. I'm so comfortable with SQL and so used to interfaces like JDBC that it was hard for me to reset my perspective and think more abstractly about what was happening.
Finding guides to properly annotating the features I wanted to solve the problems I was encountering was a proper challenge. I did find some resources, but an equal amount of it was seeking out templates and emulating other structures I could find.
Getting unit tests constructed and running was yet another challenge. I think I might come back and build out a few more tests, but currently everything passes the tests I do have on the basic CRUD procedures.
What problems did you solve and what resources did you use to solve them? I used lectures, videos, and notes a LOT this week. I reviewed the videos repeatedly, using sample code to build my starting points and then expanding it as best I could figure out to account for what I needed to do. I also made good use of the book I mentioned in my week 4 notes (Beginning Hibernate for Hibernate 5). I also used some web search results to help me resolve a few specific issues:
saveOrUpdate() wasn't properly updating my records, and this issue helped me figure out the solution to implement: https://stackoverflow.com/questions/41296314/hibernate-saveorupdate-does-not-update-existing-record-instead-it-saves-the-reco
My c3p0 was getting hung on logging deadlock error detection during some of my first testing builds, and I found details here on resolving it (getting rid of the hang): https://stackoverflow.com/questions/35015480/how-to-get-rid-of-c3p0-deadlock-error
Several entities had columns that were throwing errors and preventing my tests from passing, mostly because they were preventing my .sql script from running correctly. This link helped me to identify a few annotation parameters I could use to resolve the issue: https://discourse.hibernate.org/t/how-to-map-a-column-to-a-jpa-property-if-it-was-already-mapped-in-an-manytoone-association-when-using-hibernate/2013
I also documented a handful of sites that I found when I was still looking for ways to overcome FK constraints, disable those constraints, or otherwise make Hibernate behave more like MySQL Workbench. I realize now that they were really not helping me; I was barking up the wrong tree, and apparently I was not alone. Others seem to have had the same kind of misunderstanding about Hibernate as I did, hence actually finding answers to questions that were posed from a place of missing knowledge.
This was a big week for learning how not to handle a stressful debugging session. I got to really test the limits of my debugging and troubleshooting abilities, and while it was a stress-fest, I do feel like I gleaned some good lessons for these situations in the future.