If you follow my SO activity for the day, you'll notice I've learned quite a bit about MySQL transactions inside stored procedures. In fact, I've learned many things about MySQL transactions that are completely essential to doing them properly, yet if you read documentation on MySQL transactions, you find there are some holes missed.

Every blog post or article or documentation I've found on stored procs or transactions omitted essential things. So I would like to write a useful post. I maintain a small blog but it's, honestly, a poor place to publish something like this. I would like to put it on SO or programmers.SE as a guide. I would ask a question, self-answer, and wiki-ize.

The question is certainly "too broad" but very useful, and there are very well-loved older posts (e.g. The Definitive C++ Book List, although that's not the best example, since that's still broader than what I'm setting out to do here). Where's the line for an "essential thing"? There doesn't really need to be one - more essential things should (and will) be upvoted more. As of right now I know 5 things about writing a stored procedure with a transaction that I did not know this morning, all of which would have caused production bugs. I'm very glad I now know them, but probably have a few more that will sneak into production because while I'm more of a SQL expert than I was this morning, I am still no SQL expert. Hence, wiki-izing it, so others may post other obvious things.

Yes, I'm opening a little bit of a larger debate - the reason I'm not just posting this is I feel it would be closed as too broad, yet it strikes me as a strong use case for SO, and the proof is, in part, that there are older questions that are highly linked to that do exactly this and people like that they exist in some easy to find place - so we should keep doing that.

  • 2
    You can't come up with good questions to self-answer instead? The whole CW approach is most likely not a good one.
    – Bart
    Sep 17, 2013 at 21:21
  • @Bart no, it doesn't solve an essential problem - why would I read a question like "how do I re-throw an exception in a stored procedure?" before it's even occurred to me that I might want to? That's basically the complaint I've had, that the documentation only points "one way."
    – djechlin
    Sep 17, 2013 at 21:23
  • There are lots of good things that are none the less not suitable for the stack exchange network; such as pizza delivery. I feel this is one of those Sep 17, 2013 at 21:23
  • 1
    @RichardTingle in my post I argued that it is, so I'd ask you to explain why you feel that way.
    – djechlin
    Sep 17, 2013 at 21:24
  • 4
    @djechlin If you can't phrase it into an actual problem one could face, you're out of luck I'd say. Q&A, question and answer. Using CW to circumvent this is not the correct approach.
    – Bart
    Sep 17, 2013 at 21:25
  • 2
    You've made the case that such an article would be useful. Im less convinced by the argument that stack exchange would be a good format for such an article Sep 17, 2013 at 21:27
  • You should ask here. It might make a good article for the Programmers blog.
    – user102937
    Sep 17, 2013 at 22:04
  • related: meta.stackexchange.com/questions/182566/… "There are a small handful of questions that are not exactly appropriate for Stack Overflow, are popular and have useful answers where the primary value arises from the community's regular efforts to keep them updated via edits..."
    – gnat
    Sep 17, 2013 at 22:39
  • @RichardTingle Using pizza delivery for a reductio ad absurdum - rookie mistake. Pizza delivery is never absurd.
    – psr
    Sep 17, 2013 at 23:02
  • 1
    The majority of those "useful older questions" that I've seen were posted prior to the advent of most of the SE sites other than SO, and therefore were appropriate on SO at the time. With the creation of the rest of the SE network, those same posts would in most cases not be appropriate now. I don't see subverting the guidelines because you think you have a blog post to share as being appropriate, even though you want others to help update it. SO is established as a Q&A site, with one question per post that can be answered there, to keep SO a useful, easily searchable resource.
    – Ken White
    Sep 18, 2013 at 0:00
  • Related: Mark questions as duplicate of tag wiki, discussing Col. Shrapnel's Reference frequently asked questions about PDO which sounds similar to what you're talking about.
    – jscs
    Sep 18, 2013 at 7:44


You must log in to answer this question.

Browse other questions tagged .