Autocommit in Oralce JDBC
With introduction of Oracle Application Server, the previous oralce application, mainly oracle forms and reports, is required to immigrate to web platform. That means, Oracle JDBC, impletementing through OC4J, plays more important role in the onward application.
An problem recently experienced is that a long-writting procedure with DML statement could not be submitted without explicit commit statement. The solution for this kind of problem is always to add explicit commit definitely.
Investgating this issue, some points are listed for note.
- Autocommit option is default in oracle JDBC
- Autocommit option is required to be disabled if the select
statement follows by FOR UPDATE; Otherwise, an error ora-01002:
fetch out of sequence will arise. - By default, the DML statement in connection with Oracle JDBC will
be committed right after the successful execution. - In order to improve the performance, especially on the long
transaction, the autocommit option is disabled and smart commit
strategy or batch executing is required. - As autocommit is disabled, explicit or implict commit for batch
executing will be placed carefully.
An useful article is listed as http://www.javaperformancetuning.com/tips/jdbctransaction.shtml for “JDBC transaction performance”.
Popularity: 2% [?]
Tags:none















