Jan 20

At work we had a problem with randomly getting the org.hibernate.AssertionFailure: collection was not processed by flush exception thrown in various places.  After searching for a solution we finally found a blog that mentioned a similar issue and a working solution.

Our base model class had an overridden equals() method and hashCode() method that was causing the problem.  If you have overridden a method used for comparison in collections, such as equals(), hashCode(), compare(), be wary that your method is not causing hibernate to instantiate lazily loaded objects during flush.  We had a complex equals() method that used reflection to compare values within a model.  This is bad practice and the equals method should be overridden to check attributes that form a natural key for the object.  For performance as well as resolving this problem we changed our equals method to do the following:

  1. Check if the objects were the same: obj == otherObj
  2. Check if the objects’ surrogate keys were equal: obj.getId() == otherObj.getId() — or obj.getId().equals(otherObj.getId()), depending on your Id datatype
  3. Check if the objects’ natural/business keys were equal: obj.getSSN().equals(otherObj.getSSN())
Those are just examples and show how we fixed the issue.  The main point is that you should reevaluate your equals, hashCode, and comparator methods to determine if that is causing the flush problem.  Hibernate actually has reasoning and best practices for overriding them that you can follow here.

Credit on my team goes to Reddy Kasireddy, and to the blog where he found it:
http://www.jroller.com/jshingler/entry/org_hibernate_assertionfailure_collection_was

Jun 15

If I ever have children (according to my wife that is a ‘when’ not ‘if’ statement), I am going to put pressure on them to do well in school, but I am currently wondering the best way to do it.

Today a lot of importance is put upon grades.  ”I got all As”. “I graduated with Honors”.  ”I was in the top 5 in my class”.  ”I kept a 4.0″.  Those things are good, and if they were goals you set (or your parents set), then accomplishing them is a great achievement, and an even greater testament to your ability to commit and meet your pursuits.  However, I think it ends just at that.

What if your goal isn’t to get a 4.0, what if your goal is to get a scholarship?  What if your goal is to learn as much as possible so that you are prepared for your job when you graduate?  What if your goal is to get a great job?  I think all of those are more important goals.  The reason I say they are more important is because they have a real world impact on your life (money for school, skill set to excel at your profession, etc.).  Committing to keeping a 4.0 is an internal goal that can have secondary impacts such as getting you a scholarship, or getting you a good job, but my point is that there are other (I would argue, sometimes better) ways of getting a scholarship or getting a good job.

Now, I may be toe-ing a fine line here because my wife kept a 4.0 throughout college.  I am in no way trying to put down those types of achievements.  It points out to potential employers that you are dedicated and meet your commitments.  In her case it also coincides with great intelligence, but my point is it isn’t the only, and sometimes it isn’t even a good, indicator of great intelligence.  I went to school with several people who maintained great grades and were retarded.

So what is my point?  I want to work with my kid to come up with goals that have real world impact, and then help them make decisions to achieve those.  I think approaching it from that perspective, people realize how grades aren’t as important as we all are trained to think.

I made good grades in school (A’s in most core classes, a handful of B’s, and two C’s, one in art because that shouldn’t be a mandatory class, and one in Calculus because we had to keep a test notebook and I am unorganized).  I graduated I think 13th or 15th in my class of 425.  Did any of that help me get a scholarship?  Nope.  I got a scholarship to TTU solely because of what I made on my SAT.  Grade fail.  I got A’s/B’s in english, but got 2 semesters college credit because I took the AP test.  Same for Calculus — C in the class, several semesters’ college credit because of the AP test.  Grade fail.  Here you can already see why I am reluctant to put too much emphasis on grades.  If you actually know the material, what does it matter if you can keep your notebook organized?  If you aren’t ever going to be an artist and have the handwriting of a 2nd grader, what does it matter if you can’t draw a classmate sitting at the front of the room?  I think grades can be a decent barometer of how well you know material, but many times are skewed by inconsequential circumstances.

It continued in college.  I started out in Honors classes (terms of my scholarship, I also had to maintain a 3.5GPA).  After my first year (I still had a 3.5) I applied for an internship for java development, which I knew I wanted to do, and didn’t get it because I didn’t have any experience at all.  The classes I was taking were not preparing me for the real world.  My second year, I changed a lot of my priorities.  My new goals weren’t to make good grades, they were to experience college life (a cop out? maybe a little bit), and learn enough about development to get the job I wanted so I could start getting experience.  Needless to say, that year I lost my scholarship.  But I also had the best time of my life, met my future wife, became an atheist, and got an internship over the summer, all of which has pretty much led directly to where I am today.

Now do I regret losing my scholarship?  At the time yes, because my parents were pissed (even though I was paying fully for my college by myself, so I don’t understand it completely).  Now I don’t.  Sure things could have come out differently, but if it cost me $10K in the short term to find some of my best friends, find my wife, and a job that will pay me many times over the cost of that scholarship, then I’m glad it happened.

Ok, this post got a little off topic and went from theoretical to my life story.  So I’ll just quickly wrap it up for anyone who has read this far, maybe you can help me ponder these thoughts:

1. Is my story lucky, or have you had similar experiences with grades being overly valued and a poor barometer of anything?

2. If not grades, what is the best way to measure and help your kids measure themselves against their goals?

3. Obviously there are times when making bad grades is an indicator of issues, if I don’t make grades a high priority, will it make it harder for me to tell those times, or fix the issues?

4. Is it still better to make grades a high priority based on the ‘better safe than sorry’ approach?

May 6

noun: a belief you feel bad about, but treat as fact anyway.

usage: Ok son, don’t assume these large black men walking towards us in the alley are going to rob us, that is just a stereotype. But if they look towards us, you are on your own, because I’m effing sprinting out of here.

May 5

noun: A substance found in my body in large quantities prior to dancing, also prior to vomiting.

usage: Let me take one last shot of alcohol and then prepare to be amazed at my dancing skills. They must be laughing because I’m so awesome.

May 4

noun: An unexplainable force that causes roads to become deadlocked. Often seen near fender benders that have moved completely off the road, and semi-trucks.

usage: Man that traffic was horrible, thank God it is clearing up, I wonder what caused it? Oh well, let me slow down and look at these people on the side of the road.

May 2
Definition: Email
icon1 meezy | icon2 dictionary | icon4 05 2nd, 2009| icon3No Comments »

noun: The best excuse for failing on work obligations

usage: What?? We had a meeting today and I was supposed to present?  Did you invite me through email? Oh, yep that must have been it, my email has been screwing up all week.  I tried to send you a document yesterday, did you get it?  Yeah, see, our email server sucks.

May 1
Definition: Empire
icon1 meezy | icon2 dictionary | icon4 05 1st, 2009| icon35 Comments »

noun: A style/waist of dress that looks horrible on absolutely everyone.  Often goes with pointy witch shoes.

usage: Hey Greg, look at this Empire-waisted dress I just bought.  For some reason, me and all of my female friends love it, what do you think? Hey Greg, why are you crying?  Please don’t leave, I’ll wear something else.

Apr 30

noun: the other guy’s belief

usage: Those Hindu’s have weird superstitions about cows and being vegetarian. I just don’t eat meat on Friday’s because the Pope says so.

Apr 29
Definition: Torture
icon1 meezy | icon2 dictionary | icon4 04 29th, 2009| icon3No Comments »

verb: according to the U.S. Govt, something that should go unpunished when you do it, and is less effective if its means are revealed

usage: I can’t believe we released memo’s of how we torture, now inflicting intense pain apparently won’t hurt anymore. When the Japanese did it to us, they deserved to die (so we killed them), but we do it for the right reasons so it is all good.

Apr 28
Definition: Blog
icon1 meezy | icon2 dictionary | icon4 04 28th, 2009| icon3No Comments »

noun: a place to write things you think are profoundly important that no one else cares about

usage: I’ve started writing a new sarcastic word definition on my blog almost every day. They are hilarious. (cricket noise)

« Previous Entries