정의
abortTransaction다중 문서 트랜잭션을 종료하고 트랜잭션 내 작업으로 인해 변경된 모든 데이터를 롤백합니다. 즉, 트랜잭션 작업으로 인해 변경된 내용을 저장하지 않고 트랜잭션이 종료됩니다.
팁
In
mongosh, this command can also be run through theSession.abortTransaction()helper method.Helper methods are convenient for
mongoshusers, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.To run the
abortTransaction, the command must be run against theadmindatabase and run within aSession().
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
참고
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
구문
명령은 다음과 같은 구문을 가집니다:
db.adminCommand( { abortTransaction: 1, txnNumber: <long>, writeConcern: <document>, autocommit: false, comment: <any> } )
행동
원자성
트랜잭션이 중단되면 트랜잭션 쓰기로 인한 모든 데이터 변경 사항이 표시되지 않고 삭제되며 트랜잭션이 종료됩니다.
보안
감사와 함께 실행하는 경우 중단된 트랜잭션의 작업은 계속 감사됩니다.