On Thu, 28 Feb 2002, Perrin Harkins wrote: > All this talk about stored procedures in Perl makes me wonder. Aren't > stored procedures the kind of legacy architecture everyone is trying to > get away from? Aren't clustered application servers (like mod_perl + > selected modules) a better approach in general? > > I usually hear people support stored procs by saying that they are > cross-language, but so is SOAP and HTTP. So why is everyone so hot to > code stored procedures?
I used to be a C++ programmer. Doing the sorts of stuff we do with DBI is really hard in C++, and much easier to move large transactions into an SP for the simplicity of the language. Given that though, it becomes very easy to see that if you do have a large transaction (including multiple table updates for example), it's often safer to encapsulate that into a single stored procedure than it is to write some large chunk of Perl that turns off AutoCommit, does the work, and then commits. Plus it ensures people can use other languages to execute the same transaction. If you want to use SOAP/HTTP to emulate a stored procedure to achieve the same effect you're welcome to, but beware of the performance. -- <!-- Matt --> <:->Get a smart net</:->