The proverbial luck of the Irish was decidedly not with me the day I placed my buy order for shares of Allied Irish Banks (NasdaqOTH: AIBYY.PK).

It seemed so clear to me that brisk morning in January 2008. Here was Ireland's largest bank, conservatively run, well capitalized, and with blessedly minimal exposure to the sub-prime housing mess already engulfing banks here and abroad. Ireland's economy was strong and growing, although, yes, there were some concerns that the residential and commercial real estate markets were getting a touch frothy. Allied Irish Banks, however, had been around for over 180 years, management seemed prudent and cautious, and the company had expanded in a smart way into Poland, with a valuable banking venture in that country, as well.

What could possibly go wrong?

Trouble ahead, straight ahead
As it turned out, everything. Literally. But nothing that I could have predicted or imagined.

Despite its strong financial position, Allied Irish Banks was not immune to the financial crisis and the credit crunch that spread like bacteria in the fall of 2008. Ireland itself fell prey to the economic woes, creating pressure on Irish financial institutions weak and strong alike. Like much of what unfolded that fall and the following winter and spring, the situation for Allied Irish Banks was ever-changing and ever-worsening. And like many other banks across the globe, Allied Irish needed capital injections and, finding it difficult to raise money from anyone but taxpayers, had to accept help from the Irish government and on its terms. To say the company and its stock got walloped is something of an understatement.

(Or, to put it all more succinctly: I bought shares in a bank in January 2008 and was still holding it when the worldwide financial system collapsed nine months later.)

The 80% lesson
Thanks to Allied Irish Banks, I learned a valuable, albeit expensive, lesson. And no, I swear I'm not being sarcastic.

The truth is, investing involves risk, each and every time. I know you're probably rolling your eyes, thinking, "Yeah, yeah, we know that," but if ever there were an example of this for me, Allied Irish was it. As investors, we try to manage our risk, we try to limit it, we do everything we can to eliminate it. We can do all the research. We can have a solid investment thesis with a reasonable margin of safety. We can believe we've done everything right. And hey, we might actually have done everything right!

But a good process does not always equal a good outcome, unfortunately. Things go wrong you couldn't have imagined or planned for. Unseen risks abound. That's just part of investing, and something you've got to make your peace with.

In the end, I closed out my position in October 2009 with a nearly 80% loss. I wasn't alone, though. Allied Irish Banks had been recommended in our Motley Fool Global Gains service and in our Motley Fool Million Dollar Portfolio, with The Motley Fool itself even owning shares.

But know who else learned this "lesson?" None other than Warren Buffett, who reprimanded himself for losing a bunch of money on "two Irish banks" in his 2008 letter to shareholders, one of which is widely believed to be Allied Irish.

So, see? Sometimes even the Oracle's outcomes don't match his processes. But that doesn't mean we as investors shouldn't keep trying to limit our risk, do our research, and find companies with excellent economics that we can hold for the long term. You're not always going to get it right, but don't let that discourage you. That's just how it goes sometimes. Learn your lesson, lift up your head, and move on.