On 12/07/11 13:04, ZhangJun wrote:
mostly I use mysql, DBD::mysql,
also mssql, ODBC and sybase driver.

I cannot comment on DBD::mysql (as it has been years since I last used it) but 
both MS SQL Server and Sybase (I believe) don't support multiple active 
statements on the same connection unless you enable something like the new MARS 
support in MS SQL Server (but it has other disadvantages). I wrote a small 
document for DBD::ODBC at 
http://www.easysoft.com/developer/languages/perl/multiple-active-statements.html
 which describes the issues and workarounds.

Multiple Active Statements (MAS) are more than one statement in the same 
connection that have active work (or result-sets, Multiple Active Result Sets 
(MARS)).

If you are writing code which may connect to multiple DBDs then I'd avoid 
multiple active statements. Often they can be avoided by a simple 
reorganisation of your SQL. If you absolutely have to have them then you can 
use multiple connections but this also has other disadvantages.

Personally, I try to avoid them as much as possible and usually find the code 
using multiple active statements can be rewritten to use one.

But basically, I'm just repeating what is in the document referenced above.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

Reply via email to