コード例 #1
0
        internal bool IsOpen(out DeveelDbException error)
        {
            if (connection == null)
            {
                error = new DeveelDbException("The transaction is not associated to any connection.");
                return(false);
            }

            if (connection.State != ConnectionState.Open)
            {
                error = new DeveelDbException("The associated connection is not open.");
                return(false);
            }

            if (finished)
            {
                error = new DeveelDbException("The transaction was already finished.");
                return(false);
            }

            error = null;
            return(true);
        }
コード例 #2
0
        internal bool IsOpen(out DeveelDbException error)
        {
            if (connection == null) {
                error = new DeveelDbException("The transaction is not associated to any connection.");
                return false;
            }

            if (connection.State != ConnectionState.Open) {
                error = new DeveelDbException("The associated connection is not open.");
                return false;
            }

            if (finished) {
                error = new DeveelDbException("The transaction was already finished.");
                return false;
            }

            error = null;
            return true;
        }