다음과 같은 코드가 있습니다. (oracle 10G jdbc 사용). 이 특정 시나리오에서 트랜잭션이 커밋됩니까?Oracle JDBC Auto-Commit
public void someMethod(){
try {
OracleConnection connection = getConnectionFromPool();
connection.setAutoCommit(false);
// Do some transaction here - complete transaction, no errors occurred
...
//Throw my own exception here
throw new Exception("Custom Exception");
} catch (Exception e}
{
...
}
finally {
connection.setAutoCommit(true);
}
}
아니요, 오류가없는 경우 트랜잭션을 커밋()해야합니다. 그렇지 않으면 롤백해야합니다. –
시도하면 어떻게됩니까? –
@Sudhanshu : JDBC JavaDocs에 따르지 않습니다 (내 답변 참조). –