Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Multiple Active Statements: msg#00152

db.tds.freetds

Subject: Re: Multiple Active Statements

You are great!
thank you very much


--- Daniel Fazekas <fdsubs@xxxxxxxxxx> ha scritto: >
>
> I guess that's because you are not actually opening
> multiple connections.
>
> PHP has this not always convenient feature in that
> it caches the
> database connection parameters, and if you try to
> open the same database
> using the exact same parameters (host, login and
> password), instead of
> opening a new link, it will just return the
> previously opened
> connection's handle.
>
> This is useful for programmers who are lazy about
> passing the connection
> handle from one part of their code to another, and
> might help not to go
> over the max simultaneous connection limit of the
> database server.
>
> However, checking odbc_connect()'s documentation in
> the PHP Manual does
> not note this feature's existence or a way of
> turning it off.
>
> On the other hand, the most often used
> mysql_connect() has this:
> "If a second call is made to mysql_connect() with
> the same arguments, no
> new link will be established, but instead, the link
> identifier of the
> already opened link will be returned. The new_link
> parameter modifies
> this behavior and makes mysql_connect() always open
> a new link, even if
> mysql_connect() was called before with the same
> parameters."
>
> So that one lets you control this behavior which is
> turned on by default.
>
> Almost the same is true of mssql_connect():
> "In case a second call is made to mssql_connect()
> with the same
> arguments, no new link will be established, but
> instead, the link
> identifier of the already opened link will be
> returned."
>
> But, unfortunately, here you have no way of turning
> this off.
>
> odbc_pconnect() also notes this:
> "Future requests for a connection with the same dsn,
> user, password
> combination (via odbc_connect() and odbc_pconnect())
> can reuse the
> persistent connection."
>
>
> So, I'm guessing that either you are using
> odbc_pconnect() in at least
> one of the places, or that the PHP documentation
> people just forgot to
> note this feature's existence in the odbc_connect()
> documentation but it
> is there nevertheless.
>
>
> You can check this by var_dump()'ing the two
> supposedly different
> connection handles, and see if they are actually the
> same.
>
>
> And to solve this, you could use a different user
> name / password pair
> for the two different connection; or even simpler,
> add another ODBC
> alias to the same server, just to fool PHP into
> thinking that it's a
> different server.
>
> Now I don't know how that's exactly done in ODBC,
> it's beyond me why
> would anyone want to interface with FreeTDS via ODBC
> in PHP when you
> have sybase/sybase_ct for Sybase and mssql for
> MSSQL.
>
> Since I'm using mssql_connect(), I could simply
> duplicate the same
> connection in freetds.conf under a new name.
>
> All this has nothing to do with FreeTDS.
>
> --
> Daniel
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS@xxxxxxxxxxxxxxxxx
> http://lists.ibiblio.org/mailman/listinfo/freetds

______________________________________________________________________
Yahoo! Mail: 6MB di spazio gratuito, 30MB per i tuoi allegati, l'antivirus, il
filtro Anti-spam
http://it.yahoo.com/mail_it/foot/?http://it.mail.yahoo.com/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation