2 writes to _parser
System.Data (2)
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (2)
271
_parser
= parser;
286
_parser
= parser;
119 references to _parser
System.Data (119)
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (119)
289
Debug.Assert(null !=
_parser
._physicalStateObj, "no physical session?");
290
Debug.Assert(null !=
_parser
._physicalStateObj._inBuff, "no in buffer?");
291
Debug.Assert(null !=
_parser
._physicalStateObj._outBuff, "no out buffer?");
292
Debug.Assert(
_parser
._physicalStateObj._outBuff.Length ==
293
_parser
._physicalStateObj._inBuff.Length, "Unexpected unequal buffers.");
296
SetPacketSize(
_parser
._physicalStateObj._outBuff.Length);
384
return
_parser
;
455
Debug.Assert(
_parser
.IsKatmaiOrNewer, "NBCROW is sent by pre-Katmai server");
564
Debug.Assert(
_parser
.MARSOn, "Can not activate a non-MARS connection");
576
while ((!hasLock) && (
_parser
.State != TdsParserState.Closed) && (
_parser
.State != TdsParserState.Broken)) {
591
while ((!hasParserLock) && (
_parser
.State != TdsParserState.Closed) && (
_parser
.State != TdsParserState.Broken)) {
593
_parser
.Connection._parserLock.Wait(canReleaseFromAnyThread: false, timeout: _waitForCancellationLockPollTimeout, lockTaken: ref hasParserLock);
595
_parser
.Connection.ThreadHasParserLockForClose = true;
601
if (
_parser
.Connection.ThreadHasParserLockForClose) {
602
_parser
.Connection.ThreadHasParserLockForClose = false;
604
_parser
.Connection._parserLock.Release();
656
Debug.Assert(
_parser
.MARSOn, "Should not be calling CheckSetResetConnectionState on non MARS connection");
664
_parser
._fResetConnection = false;
666
_fResetEventOwned = !
_parser
._resetConnectionEvent.Set();
682
_fResetEventOwned = !
_parser
._resetConnectionEvent.Set();
797
if (
_parser
.MARSOn) {
809
_parser
.DecrementNonTransactedOpenResultCount();
905
return
_parser
.IncrementNonTransactedOpenResultCount();
946
_parser
.ThrowExceptionAndWarning(this, callerHasConnectionLock, asyncClose);
1005
if (
_parser
.State == TdsParserState.Broken ||
_parser
.State == TdsParserState.Closed) {
1116
this ==
_parser
._physicalStateObj,
1120
(
_parser
.IsYukonOrNewer &&
1611
if (!
_parser
.TrySkipPlpValue((ulong)length, this, out ignored)) {
1623
_parser
.ThrowUnsupportedCollationEncountered(this);
1937
if (
_parser
.State == TdsParserState.Broken ||
_parser
.State == TdsParserState.Closed) {
1962
if (
_parser
.MARSOn) { // Only take reset lock on MARS and Async.
2035
AddError(new SqlError(TdsEnums.TIMEOUT_EXPIRED, (byte)0x00, TdsEnums.MIN_ERROR_CLASS,
_parser
.Server,
_parser
.Connection.TimeoutErrorInternal.GetErrorMessage(), "", 0, TdsEnums.SNI_WAIT_TIMEOUT));
2040
if (
_parser
.Connection.IsInPool) {
2043
Debug.Assert(
_parser
.Connection.IsConnectionDoomed, "Timeout occurred while the connection is in the pool");
2044
_parser
.State = TdsParserState.Broken;
2045
_parser
.Connection.BreakConnection();
2050
else if (
_parser
.State == TdsParserState.OpenLoggedIn) {
2094
_parser
.State = TdsParserState.Broken;
2095
_parser
.Connection.BreakConnection();
2123
if (
_parser
.State == TdsParserState.Broken ||
_parser
.State == TdsParserState.Closed) {
2222
Debug.Assert(
_parser
.Connection == null ||
_parser
.Connection.Pool != null, "Shouldn't be calling IsConnectionAlive on non-pooled connections");
2226
if ((
_parser
== null) || ((
_parser
.State == TdsParserState.Broken) || (
_parser
.State == TdsParserState.Closed))) {
2232
else if ((_pendingCallbacks > 1) || ((
_parser
.Connection != null) && (!
_parser
.Connection.IsInPool))) {
2255
AddError(
_parser
.ProcessSNIError(this));
2283
if ((
_parser
== null) || ((
_parser
.State == TdsParserState.Broken) || (
_parser
.State == TdsParserState.Closed))) {
2319
Debug.Assert(
_parser
.Connection != null, "SqlConnectionInternalTds handler can not be null at this point.");
2320
AddError(new SqlError(TdsEnums.TIMEOUT_EXPIRED, (byte)0x00, TdsEnums.MIN_ERROR_CLASS,
_parser
.Server,
_parser
.Connection.TimeoutErrorInternal.GetErrorMessage(), "", 0, TdsEnums.SNI_WAIT_TIMEOUT));
2365
if (
_parser
._loginWithFailover)
2368
_parser
.Disconnect();
2370
else if ((
_parser
.State == TdsParserState.OpenNotLoggedIn) && (
_parser
.Connection.ConnectionOptions.MultiSubnetFailover ||
_parser
.Connection.ConnectionOptions.TransparentNetworkIPResolution))
2373
_parser
.Disconnect();
2382
_parser
.State = TdsParserState.Broken; // We failed subsequent read, we have to quit!
2383
_parser
.Connection.BreakConnection();
2388
AddError(
_parser
.ProcessSNIError(stateObj));
2398
if ((
_parser
.State == TdsParserState.Closed) || (
_parser
.State == TdsParserState.Broken)) {
2404
AddError(
_parser
.ProcessSNIError(this));
2477
if (source == null &&
_parser
._pMarsPhysicalConObj == this) {
2485
if (
_parser
.MARSOn) { // Only take reset lock on MARS and Async.
2530
else if ((
_parser
.State == TdsParserState.Closed) || (
_parser
.State == TdsParserState.Broken)) {
2545
Debug.Assert(
_parser
.State == TdsParserState.Broken ||
_parser
.State == TdsParserState.Closed ||
_parser
.Connection.IsConnectionDoomed, "Failed to capture exception while the connection was still healthy");
2550
_parser
.State = TdsParserState.Broken;
2551
_parser
.Connection.BreakConnection();
2565
AddError(
_parser
.ProcessSNIError(this));
2687
if ((
_parser
.State == TdsParserState.Closed) || (
_parser
.State == TdsParserState.Broken)) {
2729
bool async =
_parser
._asyncWrite; // NOTE: We are capturing this now for the assert after the Task is returned, since WritePacket will turn off async if there is an exception
2806
connectionToDoom:
_parser
.Connection);
2811
if ((
_parser
.State == TdsParserState.Closed) || (
_parser
.State == TdsParserState.Broken)) {
2815
if (
_parser
.IsYukonOrNewer && !_bulkCopyOpperationInProgress // ignore the condition checking for bulk copy (SQL BU 414551)
2827
bool willCancel = (_cancelled) && (
_parser
._asyncWrite);
2855
_parser
.CheckResetConnection(this); // HAS SIDE EFFECTS - re-org at a later time if possible
2862
task = AsyncHelper.CreateContinuationTask(task, CancelWritePacket,
_parser
.Connection);
2871
_parser
.Connection.ThreadHasParserLockForClose = true; // In case of error, let the connection know that we are holding the lock
2881
_parser
.Connection.ThreadHasParserLockForClose = false;
2897
bool sync = !
_parser
._asyncWrite;
2974
if (
_parser
.MARSOn) { // Only take reset lock on MARS.
2989
AddError(
_parser
.ProcessSNIError(this));
3005
if (
_parser
.State == TdsParserState.Closed ||
_parser
.State == TdsParserState.Broken) {
3027
if ((mustTakeWriteLock) && (!
_parser
.Connection.ThreadHasParserLockForClose)) {
3029
_parser
.Connection._parserLock.Wait(canReleaseFromAnyThread: false);
3030
_parser
.Connection.ThreadHasParserLockForClose = true;
3034
if (
_parser
.State == TdsParserState.Closed ||
_parser
.State == TdsParserState.Broken) {
3039
_parser
._asyncWrite = false; // stop async write
3045
_parser
.Connection.ThreadHasParserLockForClose = false;
3046
_parser
.Connection._parserLock.Release();
3081
_parser
.Connection.ThreadHasParserLockForClose = true;
3083
Debug.Assert(
_parser
.Connection != null, "SqlConnectionInternalTds handler can not be null at this point.");
3084
AddError(new SqlError(TdsEnums.TIMEOUT_EXPIRED, (byte)0x00, TdsEnums.MIN_ERROR_CLASS,
_parser
.Server,
_parser
.Connection.TimeoutErrorInternal.GetErrorMessage(), "", 0, TdsEnums.SNI_WAIT_TIMEOUT));
3087
_parser
.ProcessPendingAck(this);
3091
_parser
.Connection.ThreadHasParserLockForClose = false;
3097
if (
_parser
.State == TdsParserState.OpenNotLoggedIn &&
3098
_parser
.EncryptionOptions == EncryptionOptions.LOGIN) {
3107
_parser
.RemoveEncryption(); // Remove the SSL Provider.
3108
_parser
.EncryptionOptions = EncryptionOptions.OFF; // Turn encryption off.
3191
SqlStatistics statistics =
_parser
.Statistics;
3450
var parser =
_parser
;