Re: Resource id #X

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, August 18, 2005 1:00 am, Chris Boget wrote:
> * User A accesses page X, which makes a connection to the database.
> Echoing
> out the result of the mssql_pconnect() function shows it's using
> 'Resource id #10'.
> * User B accesses the same page, X, making another connection to the
> database.
> Echosing out the result of the pconnection function shows it's using
> 'Resource id
> #10'
>
> Now, even though they are showing the same resource id, it's not
> actually the
> same connection, correct?

Correct.

If you echo out EVERY connection/result/resource, you will see that
PHP pretty much just starts counting at 1 at the beginning of a script
and increments the resource counter on each resource.

Change the script to, say, connect to some other database at the top,
and everything will be "off" by 1 from the previous user.

> BEGIN TRAN (user a)
> BEGIN TRAN (user b)
> Query (user b)
> Query (user a)
> ROLLBACK (user b)
> COMMIT (user a)
>
> with User B rolling back User A's transaction and User A committing
> User
> B's
> transaction (or no transaction at all).

Hmmmmm.

Take out the _pconnect.

Or switch to MySQL or PostgreSQL maybe for a test, just to see if
their transactions exhibit the same behaviour.

SQL Server is the least-broken Microsoft product...

You could also try using the Sybase drivers to connect to MS SQL.

Last I heard, they were faster anyway.  Though it's been years since
anybody has had enough money to get me to use an MS product.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux