r/ProgrammerHumor • • Jul 20 '18

Every Time

Post image
52.2k Upvotes

749 comments sorted by

View all comments

Show parent comments

22

u/Dillawnz Jul 20 '18

This one time I kept getting a Hibernate exception so I set a break point to check out what was going on. After reading everything I continued running and it ran fine... I did some more tests and realized that it worked fine if I created a break point and waited about 10 seconds before continuing ¯_(ツ)_/¯ (eventually came up with an actual solution but still a heh moment)

8

u/robi4567 Jul 20 '18

Did you have to wait the 10 seconds and if so did you ever find out why you had to wait the 10 seconds. Because that makes no sense to me.

13

u/mw9676 Jul 20 '18

An async call needed to complete?

1

u/Dillawnz Jul 20 '18

I'm no expert, but I think you have to explicitly specify asynchronicity for Hibernate and it wasn't used for many purposes on the project (definitely not here, at least).

1

u/Dillawnz Jul 20 '18

This was last summer so I don't remember it super clearly, but I think the Hibernate session was ending prematurely. Then for some reason doing someEntity.getAttribute() prevented it.

1

u/vige Jul 20 '18

The standard solution is to add a debug print. It's usually enough to fix the problems.

1

u/Jrquick Jul 20 '18

Something like this happened to me. Except it only worked in the debugger because I had a watch variable in IntelliJ that was changing a value on break points.

1

u/Allways_Wrong Jul 21 '18

This is common behaviour.

Crashes. Set up a message to spit out some values at some point (debuggers are for wimps). Message indicates everything is as expected.

Remove message. Scratch head. Run again. Works now.

...I’m starting to think it really is a quantum effect, and our observations collapse it. : |