TransactionalNodeService.Common.TransactionOperations.SessionFinalisation.ExecuteCompleteSession C# (CSharp) Method

ExecuteCompleteSession() public method

public ExecuteCompleteSession ( ) : void
return void
        public void ExecuteCompleteSession()
        {
            using (IDbConnectionAbstraction sessionDbConnection = GlymaSession.ConnectionFactory.CreateSessionDbConnection())
            {
                SqlCommand command = CreateCompleteSessionCommand(sessionDbConnection.Connection);

                sessionDbConnection.Open();
                command.ExecuteNonQuery();
                sessionDbConnection.Close();
            }
        }

Usage Example

        public MapResponse CompleteTransaction(IGlymaSession glymaSession, Guid sessionId)
        {
            MapSession session = glymaSession.Session;

            MapResponse response = new MapResponse();

            using (IDbConnectionAbstraction parametersDbConnection = glymaSession.ConnectionFactory.CreateParametersDbConnection())
            {
                while (session.Count > 0)
                {
                    MapTransactionWrapper transaction = session.Dequeue();

                    transaction.ExecuteOperation(ref response);

                    transaction.ResponseParameter.PersistSessionObject(parametersDbConnection);
                }

                SessionFinalisation sessionFinalisation = new SessionFinalisation(glymaSession, sessionId);
                sessionFinalisation.ExecuteCompleteSession();

                return response;
            }
        }