달력

4

« 2024/4 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
Oracle9i JDBC Developer's Guide and Reference
Release 2 (9.2)


테스트 할 일이 있어서 오랜만에 JDBC 로 select / update 하는 걸 만들어서 돌렸는데...

con.setAutoCommit(false);


이렇게 설정을 해 놓고...

select 를 하고, update 하는 코딩을 하고.

실제 돌기 전에 테스트를 하려고, 마지막에 rollback/commit 을 넣지 않고. 

 
그냥 돌려봤는데......

헐.. update 한 것들의 commit 이 되어 버렸다는...

이건 무슨 상황인지..

분명히 auto commit 은 disabled 해놨고, 코드 끝에 commit 이란걸 하지도 않았는데 

왜 자동 커밋이 되버리냐고 -_-;

내가 알던 것과 다른 상황이 벌어져서 한~~참을 뻘짓거리 하면서 뒤져봤더니..

Oracle9i JDBC Developer's Guide and Reference Release 2 (9.2)   

요 문서를 보면....

Important:
  • If auto-commit mode is disabled and you close the connection without explicitly committing or rolling back your last changes, then an implicit COMMIT operation is executed.
  • Any DDL operation, such as CREATE or ALTER, always includes an implicit COMMIT. If auto-commit mode is disabled, this implicit COMMIT will not only commit the DDL statement, but also any pending DML operations that had not yet been explicitly committed or rolled back.

 
이렇게 씌여져 있었다는.

즉,
 

"auto-commit 을 disabled 한 상태에서 명시적으로 commit/rollback 을 호출하지 않으면 자동으로 commit 이 되버린다"

 
허.. 왜 몰랐을까 ㅜㅜ 
:
Posted by 뽀기