Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Programming / SQL / July 2008

Tip: Looking for answers? Try searching our database.

Is it possible to get the same @SPID for two TableAdapter instance?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Max2006 - 23 Jul 2008 15:14 GMT
Hi,

I am relying on @@SPID to create temporary data in my stored procedures.
The scope of temporary data is a single SQL Server session.

The technique is called Process-Keyed Tables and it is described here:
http://www.sommarskog.se/share_data.html#prockeyed

Is there any possibility to have the same @SPID for two instance of the same
TableAdapter class?

I am concern about connection pooling. If two instance of a TableAdapter get
the same @SPID the temporary data will be mixed and that won't be good!

Any help would be appreciated,
Max
William Vaughn (MVP) - 23 Jul 2008 17:53 GMT
Unless you disable the setting, a subsequent connection does not inherit the
state of a previous owner of a pooled connection. While the state is
maintained until the connection is reused, before any other operations are
passed, the connection is "reset" to clear the state.

Signature

__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205  (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________

> Hi,
>
[quoted text clipped - 13 lines]
> Any help would be appreciated,
> Max
Max2006 - 23 Jul 2008 20:45 GMT
Hi William,

Thank you for help.

What is the setting? I just want to know, so I won't become disable by
accident.

BTW, I am a fan of your Hitchhiker book series.

Thank again,
Ali

> Unless you disable the setting, a subsequent connection does not inherit
> the state of a previous owner of a pooled connection. While the state is
[quoted text clipped - 18 lines]
>> Any help would be appreciated,
>> Max
William Vaughn (MVP) - 23 Jul 2008 21:04 GMT
Check out the ConnectionReset=True key/value pair. It defaults to True.
Nope, don't touch this unless you want to let subsequent pooled connection
users lie in the dirty sheets slept on by earlier users.

See Chapter 9 of the 7th edition.

Signature

__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205  (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________

> Hi William,
>
[quoted text clipped - 30 lines]
>>> Any help would be appreciated,
>>> Max
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.