public void WrapException(Exception AException, string AStatement, bool AMustThrow) { if (!IsConnectionValid()) { if (InTransaction) { FTransactionFailure = true; } FState = SQLConnectionState.Closed; } else { if (InTransaction && IsTransactionFailure(AException)) { FTransactionFailure = true; } } Exception LException = InternalWrapException(AException, AStatement); if (LException != null) { throw LException; } if (AMustThrow) { throw AException; } }
internal void SetActiveCursor(SQLCursor cursor) { if ((cursor != null) && (_activeCursor != null) && !_supportsMARS) { throw new ConnectionException(ConnectionException.Codes.ConnectionBusy); } if ((_activeCursor != null) && _activeCursors.Contains(_activeCursor)) { _activeCursors.Remove(_activeCursor); } _activeCursor = cursor; if ((_activeCursor != null) && !_activeCursors.Contains(_activeCursor)) { _activeCursors.Add(_activeCursor); } if (_activeCursors.Count > 0) { _state = SQLConnectionState.Reading; } else if (_activeCommands.Count > 0) { _state = SQLConnectionState.Executing; } else { _state = SQLConnectionState.Idle; } }
public void WrapException(Exception exception, string statement, bool mustThrow) { if (!IsConnectionValid()) { if (InTransaction) { _transactionFailure = true; } _state = SQLConnectionState.Closed; } else { if (InTransaction && IsTransactionFailure(exception)) { _transactionFailure = true; } } Exception localException = InternalWrapException(exception, statement); if (localException != null) { throw localException; } if (mustThrow) { throw exception; } }
public void CheckConnectionValid() { if (!IsConnectionValid()) { if (InTransaction) { FTransactionFailure = true; } FState = SQLConnectionState.Closed; throw new ConnectionException(ConnectionException.Codes.ConnectionClosed); } }
internal void SetActiveCommand(SQLCommand ACommand) { if ((ACommand != null) && (FActiveCommand != null)) { throw new ConnectionException(ConnectionException.Codes.ConnectionBusy); } FActiveCommand = ACommand; if (FActiveCommand != null) { FState = SQLConnectionState.Executing; } else { FState = SQLConnectionState.Idle; } }
internal void SetActiveCursor(SQLCursor ACursor) { if ((ACursor != null) && (FActiveCursor != null)) { throw new ConnectionException(ConnectionException.Codes.ConnectionBusy); } FActiveCursor = ACursor; if (FActiveCursor != null) { FState = SQLConnectionState.Reading; } else if (FActiveCommand != null) { FState = SQLConnectionState.Executing; } else { FState = SQLConnectionState.Idle; } }
internal void SetActiveCommand(SQLCommand command) { if ((command != null) && (_activeCommand != null) && !_supportsMARS) { throw new ConnectionException(ConnectionException.Codes.ConnectionBusy); } if ((_activeCommand != null) && _activeCommands.Contains(_activeCommand)) { _activeCommands.Remove(_activeCommand); } _activeCommand = command; if ((_activeCommand != null) && !_activeCommands.Contains(_activeCommand)) { _activeCommands.Add(_activeCommand); } if (_activeCommands.Count > 0) { _state = SQLConnectionState.Executing; } else { _state = SQLConnectionState.Idle; } }
protected void SetState(SQLConnectionState AState) { FState = AState; }
protected void SetState(SQLConnectionState state) { _state = state; }