Thursday, August 28, 2014

UMD - 20 Year's Ago this Labor Day

20 years ago on Labor Day weekend, my parents and brother’s dropped me off at UMD.  I believe it was a Saturday, possibly mid-morning.  After a few tears and hugs, they took off in the green Aerostar and headed back to Hayward, MN.

My first memory of UMD was walking down the hall and noticing that two doors down on the opposite side of the hall, an obnoxious, hyper, loud talking jackass was telling his tall, bookish roommate (the Doctor) how good Metallica sounded on his speakers.  And how cool it was to have tinfoil over their window to block out the sun.  All the while drinking Cherry Pepsi and yelling out Pearl Jam lyrics.

My roommate, Chris Beese, and his family ended up showing up that afternoon.  Upon arrival, Chris’s dad Gary Beese, took the opportunity to break in the Grigg’s A (1st floor) bathroom and shower.  After drying off and exchanging pleasantries, Chris kicked them out of the room and decided it was time to start meeting the neighbors – after reading a chapter of his latest Star War’s book of course.

From what I remember, Chris warmed up to the new neighbors right away – Eddie Vedder included.  Could have been the Cherry Pepsi, or the fact the Doctor was a hunter, or that they both had cars.  I shied away, primarily because of how proud they were of being from “The Cities,” which I immediately presumed meant they were rich.  In any sense, we agreed to hit the freshman dance at the Kirby Ballroom later than evening.

Turns out that our interest in finding house party trumped staying at the dance for any length of time, and being both Eddie and the Doctor had cars, we were mobile.  Odd as it may sound, I had run into an upper classman by the name of Tom Goodnature in the parking lot earlier that day.  I knew Tom from back in Albert Lea, and even back then, he seemed to have a good sense on where the party was.  He had mentioned the possibility of having  some people over at his place, and so with that hint of an opportunity, we took off to drink a few beers at Goodie’s place.

The rest is mostly history.  After loosening up on five to six Milwaukee’s Best, turns out Eddie and the Doctor weren't that bad after all.  20 years later, along with the myriad others I met at UMD, we remain good friends.  Though, Eddie has stressed this friendship on a number of occasions – getting strip searched at the Canadian border included.

Decided to share this story for the 20th anniversary of our freshman year at UMD!  Go Bulldogs!

Monday, April 01, 2013

Notes on Spring's OpenSessionInViewFilter and Hibernate's LazyInitializationException

I'm writing this down so I can reflect on it when the healing ends. I basically spent the last five days moping around the house figuring that my life as a below average programming hack was over.  (Fortunately this is just a hobby and I have a day job.)  I was trying to use Hibernate with MySQL along with Spring 3.2's Hibernate Transaction Management so I didn't have to worry as much about cleaning up after myself. I'm using Spring's MVC for controlling the user interface stuff.

The issue I was running into initially was a "org.hibernate.LazyInitializationException: could not initialize proxy - no Session" when returning my view and whipping through the objects. This kind of made sense to me since I knew the Hibernate Transaction Management piece (annotated as @Transactional) was doing its job of closing the Session.

My first whack at things were to Eagerly load by objects. While this did fix the issue initially, I quickly found that this was the wrong, the very wrong, approach. I was loading my object, my object's collection of objects, those object's objects, those objects collection of objects, and so on. Once could argue my object relationships could use some scrubbing, but that aside, Eager loading was not the answer.

If you Google LazyInitializationException you'll get a number of references to using Spring's OpenSessionInViewFilter. The logic here is that by using this filer, or writing your own if you're smart enough, is that it has hooks into the Transaction Manager such that together they will keep the Session open until the request has finished. This means that you can still Lazy load things, and whip through stuff in your view. Then after request is finished, the OpenSessionInViewFilter will take care of closing the Session. This was perfect!!!

But like most things in my life, getting his implemented wasn't as easy as you'd think. After wiring up the filter, I didn't get any change in behavior. Still got the error message "org.hibernate.LazyInitializationException: could not initialize proxy - no Session." I gave the OpenSessionInViewInterceptor version a try, but no go. Same error.

Stepping back a second. When I first got started writing this application a few weeks back, I noticed some odd behavior. When I launched the application and my beans were created, I was ending up with two database connections showing up on the MySQL side. Without any requests coming in, I should just have one. But I never thought much of it though. And as it turned out, I should have really paid attention to this.

I don't have much experience in doing this, but I was at such a point in my disillusion, that I attached the Spring 3.2 source to my libraries and started walking through the OpenSessionInViewFilter and HibernateTransactionManager code. In here I could see where the filter "binds" a newly created Session to the hibernate transaction manger and then where the transaction manager tries to fetch that Session from its binding. For some reason, the transaction manager was never finding the Session that the filter was putting in there. You could see the filter open a Session, then the transaction manger open a second Session after failing on a Session lookup. Even a dummy like me found this fishy.

I'm not sure if was the morning coffee or evening beer, but something fired in my mind and made me think back to those two database connections. Could there be a relationship? And as it turns out, there was.

I'm sure it's much more complicated that this, or much more simple, but essentially what was happening was I was instantiating Spring twice. I was loading it once with my MVC Dispatcher Servlet and then again with the Context Listener. Along with everything else, this was creating two HibernateTransactionManager beans. So I believe what was happening was, the OpenSessionInViewInterceptor was setting a Session on one transaction manager bean, but the other transaction manager bean was taking care of the transaction pieces and thus not finding the Session that the filter gave it.

After all this, I stopped instantiating Spring twice and the world started to align for me. So far the OpenSessionInViewFilter is working just fine. I'm able to lazy load my options and properly return my views. For a ton of reading in this problem a good place to start is issuing this Google search "site:stackoverflow.com opensessioninviewfilter lazyinitializationexception".

Friday, September 14, 2012

2011 West Blue Golf League - Results

Here are the results from the 2011 West Blue Golf League.

Playoffs
1st - Kraft Dinner
2nd - Pinseekers
3rd - Bushwoods (over a crumbling Double Eagles)
Consolation = Swing Doctors (over Golf Gods in a squeaker)

The tournament weather was a bit chilly and wet if I remember.  Not nearly wet enough though to prevent Trzynka from nearly killing former Thomson Reuters employee Mike Grey with a long draw down the left hand fairway (road).  Impressive aim.

Attention critics:  Notice how we had one three-sum this year and they finished with par.


Tournament
1st - Hunecke, Steigerwald, Rehfeld, Rager (-9)
2nd - Thoresen, Noland, Fermole, Miller (-8)
3rd - Grausnick, Meggitt, Wendt, Wiegel (-7)
4th - Hanson, Wagner, Mohs, Augeson (-7)
5th - B. Kuznia, Rademacher, Spilman, Burch (-6)
6th - Harlow, Kroening, Schwartz, Helmueller (-6)
7th - Sole, Maurer, Trzynka, Olenius (-6)
8th - Porter, Dietsche, Remarke, Vlasak (-6)
9th - Tschida, Ronning, Walberg (par)

Longest Drive #3 - Harlow (290 yards)
Closest to pin #7 - Augeson (10 feet)
Closest to pin #12 - Tschida (10 feet)
Closest to pin #16 - Grausnick (10 feet)
Longest Put #18 - Meggitt (19.5 feet)

Five skins were awarded in a year with no eagles. Grausnick's team on #8 with a birdie, Thoresen's team on #9 with a birdie, Harlow's team on #13 with a birdie, Hunecke's team on #16 with a birdie, and Tschida's team with a birdie on #17.

Friday, December 02, 2011

My Time. My Boys.

Many of you may have wondered why within the last year I've written a total of four blog posts, this being the fifth. Oddly enough, my lack of anything remotely personal, such as blogging, has disappeared now that I have not one son, but two. It's not so much the diaper changing that swallows your time. It's the diaper change after the diaper change, followed by playing football and baseball - in the living room when mom's not home - and the occasional snow man, bath, feeding, doctor visit, and temper tantrum. It's amazing how much time those things take away from your personal space and time.

But you know what? It's totally worth it. Spending time with my boys is the greatest experience I've ever had. No, I don't have time for happy hour, blogging, working out on Saturday mornings, or reading a book a week. The things that fill up this space such as skating and skiing lessons, watching my baby army-crawl towards the Christmas tree, educating the oldest that to get a good swing on a ball you have to come down on the ball (even though it defies what your mind is telling you), are things that I wouldn't change for anything in the world.

Now, off to watch Handy Manny and scream at the oldest to clean up his toys.

Monday, August 22, 2011

2011 Militia Open

Here are the results from the 2011 Militia Open. These are brought to you by Justin Bieber and a panda.



Longest Drive #4 = Jake
Closest To The Pin #7 = Mac
Closest To The Pin #11 = Mac
Closest To The Pin #13 = Jake

1st = Aaron/Patrick (75)
2nd = Keith/John McN. (78)
3rd = Jake/John Wild. (79)
4th = Mac/John Sch. (79)

It's believed that the 75 by Aaron and Patrick is a Militia record.

Wednesday, August 17, 2011

My Gopher Football Schedule - 2011

Here is our lineup for the 2011 Gopher Football scheduled with Coach Kill.

09/10/11 - New Mexico State (Matt)
09/17/11 - Miami - Ohio (Sell)
09/24/11 - North Dakota State (Mac)
10/22/11 - Nebraska (Mac & Matt)
10/29/11 - Iowa (Mac)
11/12/11 - Wisconsin (Matt)
11/26/11 - Illinois (Mac & Matt)

Wednesday, December 08, 2010

My Proust Questionnaire

Here is my Proust Questionnaire for writing class.


What do you want people to say about you 100 years from now? The amazing thing is that he's still sexually active.

Why does your wife stay with you? We both ask ourselves this daily.

What is your dream job? Writing some useless, yet extremely expensive and needy, software from a Northern Minnesota cabin after a morning of golf.

How many years have you been in school? 28 years, and counting.

What are you most proud of? My children.

Your name is Mac, why don't you use a Mac? Because my wife is cheap. I do have an iPhone though, which took, among other things, begging.

Who do you despise? I get along with most anyone, with the exception being the people I don't get along with.

How many books have you sold? Not nearly enough to retire.

Your desk is always messy. Does that mean your unorganized? I don't see it as being messy. I see my desk as being busy. If you have time to clean your desk, you're not nearly busy enough.

Who is your favorite author? Bill Bryson. Who else?

What is your favorite music? I listen to country and rock. And while working out, I occasionally listen to genre that I won't admit in public.

Who do you most admire? My dad. Everyday I look in the mirror and see myself becoming him. And I'm good with that. He's a great guy.

Why don't you go to church very often? This is a dilemma for me as I want my children to grow up with some religious background. My wife is Catholic and I'm Lutheran. That means we'll join a catholic church. I have issues with giving that organization money.

Will you someday own a BMW? Who's buying it for me? I like Hondas. The only thing they need is gas. And often not even that.

Will you ever move from Minnesota? Never say never, but I can't see my family leaving the Twin Cities. My wife wouldn't have her mother to shop with, and that would be unfavorable for all of us.

Who cooks? Occasionally my wife does. We often outsource. Thus my weight gain.

Where is your favorite place to vacation? Oddly enough, we really like the North Shore of Minnesota. Our best times have been by the lake with a few cocktails.

What is your favorite beer? Anything you're buying. Honestly, right now it has to be Surly Furious. Though, I'm willing to try most anything, with the exception of Jacob's Best.

What is your biggest regret? I missed a blocked punt in 11th grade against Fairbault. Wish I had that one back. And, back between the ages of 18 and 23, I wish I knew then what I know now. This is a catchall for a few things.

Tuesday, December 07, 2010

Thoughts on Coach Kill

When Coach Jerry Kill was announced as Gopher Football coach, I, like many alumni and season ticket holders said "who?" Top on my list was Marc Trestman and Mike Leach. Both would have brought national attention to the program and given us the prominence we need.


I didn't have a grip against Coach Kill, it was just that I had never heard of him. (Though I had seen him as they beat the Gophers this year and I was unfortunately at the game.) He was from a non-BCS conference and someone that wasn't once mentioned as a candidate.

This all being said, after reading no less than 10 articles on Kill and finding out from my brother that he called all Northern Illinois season ticket holders in 2010 thanking them for their business, I have become a big fan.

Coach Brewster drove me ^%$#ing nuts with his grand pontifications about Rose Bowls and Big Ten titles. As an alumni and season ticket holder, I'm not unaware that our most immediate goals should be beating a team from Dakota and getting bowl eligible again. Brewster should have taken the patch of Rose Bowl grass and burned it after losing to South Dakota.

I figure myself as a pretty good judge of character and within the first three minutes of listening to Brewster, I knew we were screwed. After reading and listening to Kill on the radio. I think we have a chance. I really feel that this down-to-earth, coach who has won at every level, manager who has kept almost his entire staff intact the past 15 years, businessman who called every season ticket holder last year, will do fine job.

I'm taking a big gamble here by saying this, but I'm betting Coach Kill is here for the next 20 years.

Sunday, October 24, 2010

Walter Football

I run a small NFL Pick'em league where you have to pick the winner against the spread. It's just like in Vegas, though without the free drinks and smoking.

To gain an edge against my opponents, I wrote a small program that uses the line and home field advantage to create some synthetic numbers based on data I get from USA Today. So far I'm 44-41 using it.

I've been looking for some other data to add into my algorithm and in the process came across Water Football. If you think I get a bit nutty with data (e.g. my yearly golf scores, puts, greens and fairways hit are recorded in a spread-sheet), this guy has crazy stuff.

His picks take a bit to get through each week as he writes a novel for each game. But if you're really into Pick'em leagues, this guy is the bomb (technical term). He has his weekly and yearly winnings (he must play online or live in Vegas), which I find interesting to look at. I'm not sure if they are real, but he did admit losing over $1000 last week, so at least he has some humility if he's lying. Looking at the results, I think he's probably being fairly honest.

If you have a few minutes (more like a hour) to waste, check out his site. Good stuff if you're into fantasy sports and Pick'em leagues.

Friday, October 22, 2010

Bond Valuation Class

I just finished up with a course on bond valuation at the U of M. If I end up passing, I'll have two classes left to finish my MBA.


The first thing you learn about taking a class on bond valuation is that you should never take a class on bond valuation. For those of us not in finance, time value of money is tough enough. Toss in trying to value static spreads, forward rates, and locked in arbitrage opportunities, we're thrown for all kind of loops.

The professor was not only a professor, but the head of finance at Carlson. He was a very good teacher, but gave us more work than a full-time working father/husband cared for. Five homeworks (hard homework), three quizzes, two group homeworks, five short papers (really short) and a final. All for a seven week class. Seemed a bit demanding to me, but I struggled through it.

My next class is on business writing, which should prove to be far less demanding than calculating the yield to maturity using treasury spot rates. Lets at least hope so.

Wednesday, September 15, 2010

2010 West Blue Golf League - Results

Here are the results from the 2010 West Blue Golf League.

Playoffs
1st - The Mulligans
2nd - Swing Doctors
3rd - Earth Movers (over Mentally Handicapped)
Consolation = Pinseekers (over Double Eagles)

The tournament weather was around 70 degrees, but with a prevailing two-club wind. I'm thinking the wind, along with the Gopher Football's poor play against South Dakota, affected most of the players (Travis Ranger and Jim Conry excluded). Compared to years past, scores were down about three strokes. We also had our first + score under my tenure. Unacceptable.

Lastly, the three-sum taking second was due to a no-show. The two defined three-sums finished 9th and 12th.

Tournament
1st - Bjerken, Wagner, Spilman, Schwartz (-9)
2nd - Porter, Braxmeier, Remarke (-8)
3rd - Gleiter, Trzynka, Fermoyle, Gebhart (-7)
4th - Price, Noland, Loya, Gerding (-6)
5th - Steigerwald, Conry, Englert, Finander (-6)
6th - Kuznia, Prout, Rehfeld, Walberg (-5)
7th - Hanson, Augst, Harlow, Piere (-5)
8th - Sole, Lenz, Ronning, Rowan (-3)
9th - Wendt, Madigan, Mohs (-3)
10th - Schwartz, Kroening, Olenius, Rager (-3)
11th - McNaughton, Hunecke, Grausnick, Vlasak (-2)
12th - Meggitt, Tschida, Daml (+2)

Longest Drive #3 - Gerding (280 yards)
Closest to pin #4 - Fermoyle (not even close)
Closest to pin #7 - Prout (driver into the wind)
Closest to pin #16 - Bjerken
Longest Put #18 - Rager

Two skins were awarded. The Gleiter, Trzynka, Fermoyle, Gebhart team eagled #1 for the first (second year in a row that a eagle took a skin here). And the Bjerken, Wagner, Spilman, Schwartz team birdied #11 for the second.