CodeSOD: No Lifeguard in this Connection Pool

This post was originally published on this site

The Daily WTF

Michael was debugging a system where the J2EE service would just… crash. It was running on a Windows host set to restart the service when this happened, so the outages were brief, but it was a serious problem.

He eventually tracked down the problem to a class called JdbcSchema, which is about 1,100 lines of homebrew database management code. It does “fun” things, like create extra tables in the database to track “foreign key metadata”.

Or, for real fun, it has a getTransIsolation function, which returns the transaction isolation your query should use. If you’re thinking to yourself, “doesn’t the transaction isolation depend on the specific query and workload?” you’d be right- this function changes what transaction isolation all queries are supposed to use based on the time of day. Presumably, this was to support batch processing at night, but it’s a bonkers way of going about it.

None of

To read the full article click on the 'post' link at the top.