Toilet Stall Deadlock

October 4, 2006 at 11:54 pm 1 comment

A few years ago, I had a whim.  I wanted to write a book that explained database concepts in the terms of toilet, bathroom and excrement analogies.  For deadlock I had this example:

The bathroom has two stalls, each occupied by a person who needs to take a dump.  Person A is patiently waiting for the other occupant to leave before they release their bowels (and any accompanying sound effects).  Little do they know– Person B also needs to take a dump and is waiting for Person A to finish!  So both people are sitting on toilets, stifling urges and waiting for the other one to depart.  

Unfortunately that was the only example I came up with and as amusing as I may think it is, it doesn’t quite constitute a book.  But I did get to smile and think about it this morning when Derek and I ran into a deadlock* (the database type) this morning. 

We were trying to track down an Oracle issue, so we got into SQL*Plus and inserted some records into a particular table.  When we went to the application, our changes were not being displayed.  Worse even, when we tried to make changes to the same table through the application it hung indefinitely.  Oracle folks, know what we did wrong?

That’s right– SQL*Plus commands do not commit their changes until you close the tool or you explicitly type in commit; 

Our changes through the SQL*Plus tool were still in limbo so when the application went to make the its changes– it found itself patiently waiting for SQL*Plus to release the table so it could have the same privacy coveted by our bathroom goers.  SQL*Plus was lingering open, so our application waited and waited and waited… until Derek and I finally caught on.

Even if it doesn’t make for a book, perhaps one day you’ll run into some peculiar behavior with your Oracle database and SQL*Plus.  Out of frustration, you step away from your desk and take a trip to the bathroom and when you plop down on the seat– maybe you will recall this post and realize what is going on.  🙂

*Okay, so it isn’t an official deadlock because the SQL*Plus isn’t waiting for a resource the application has— but the segue was close enough me!

Entry filed under: Oracle, toilet.

Iwo Jima, V-J Day… and Toddlers Great Smokey Mountains: Quick Recap

1 Comment Add your own

  • 1. Derek  |  October 5, 2006 at 12:56 pm

    Well I’m glad you specified that the deadlock we ran into was the database kind! The two of us should never get into the other situation. 🙂 I love the book idea though… I’d buy it! 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed

Flickr Photos

3D Printed Products


%d bloggers like this: