N
N
Nikolai Pavlov2014-04-24 12:19:34
Oracle
Nikolai Pavlov, 2014-04-24 12:19:34

How to disable Oracle autocommit on connection break?

I have a problem.
There is a java application that communicates via jdbc with oracle db. In general, a standard question.
There is a transaction in which quite a lot of insert query is done. And so, during transaction there is a break of connection and oracle does commit on the current available state.
How can I disable this feature using jdbc?
And immediately a documentation conflict.
The link http://docs.oracle.com/cd/E16655_01/java.121/e1765... says the following:

If the 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 run.

And following the link docs.oracle.com/cd/E11882_01/server.112/e40540/tra...
End of a Transaction
A transaction ends when any of the following actions occurs:
...
A client process terminates abnormally, causing the transaction to be implicitly rolled back using metadata stored in the transaction table and the undo segment.

Logically, the first link refers to jdbc, the second to oracle. And commit, apparently, does jdbc, but in practice it turns out that commit is still done by Oracle, because no connection to base.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Duke_Raven, 2014-05-07
@Duke_Raven

It seems you need to set the connection option
docs.oracle.com/javase/6/docs/api/java/sql/Connect...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question