java.sql.SQLException: Could not commit with auto-commit set on at...
I just upgrade to new jdbc driver from classes12.jar to ojdbc7.jar
My app threw an exception when was running with ojdbc7.jar:
java.sql.SQLException: Could not commit with auto-commit set on
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:4443)
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:4490)
at oracle.jdbc.driver.T4CConnection.doSetAutoCommit(T4CConnection.java:943)
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:4
My app still run normally with classes12.jar.
I researched on oracle:
This exception is raised for any one of the following cases:
- When auto-commit status is set to true and commit or rollback method is called
- When the default status of auto-commit is not changed and commit or rollback method is called
- When the value of the COMMIT_ON_ACCEPT_CHANGES property is true and commit or rollback method is called after calling the acceptChanges method on a rowset
But i couldn't find mistake in my source. Please help me give more explaination about this error.
java oracle jdbc
add a comment |
I just upgrade to new jdbc driver from classes12.jar to ojdbc7.jar
My app threw an exception when was running with ojdbc7.jar:
java.sql.SQLException: Could not commit with auto-commit set on
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:4443)
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:4490)
at oracle.jdbc.driver.T4CConnection.doSetAutoCommit(T4CConnection.java:943)
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:4
My app still run normally with classes12.jar.
I researched on oracle:
This exception is raised for any one of the following cases:
- When auto-commit status is set to true and commit or rollback method is called
- When the default status of auto-commit is not changed and commit or rollback method is called
- When the value of the COMMIT_ON_ACCEPT_CHANGES property is true and commit or rollback method is called after calling the acceptChanges method on a rowset
But i couldn't find mistake in my source. Please help me give more explaination about this error.
java oracle jdbc
1
Try settingconnection.setAutoCommit(false);
– user432
May 30 '14 at 11:31
1
Make sure you're using JDK7: that's what the "7" means in "ojdbc7". The classes12.jar is JDK 1.2 vintage - you should have changed years ago. Don't be fooled by "my app still runs normally with classes12.jar". You should not use that ever again.
– duffymo
May 30 '14 at 11:33
Given the callstack I'd suspect a bug in the driver. When switching between autocommittrueandfalse(and vice versa), the driver must commit the active transaction, and it looks like this commit fails because the driver is in autocommit. On the other hand, I'd expect Oracle to thoroughly test their driver for these kind of basic state switches.
– Mark Rotteveel
May 30 '14 at 11:44
@MarkRotteveel: Please look at this question. stackoverflow.com/questions/27272317/… I think my question is related to this thread
– UI_Dev
Dec 3 '14 at 13:24
add a comment |
I just upgrade to new jdbc driver from classes12.jar to ojdbc7.jar
My app threw an exception when was running with ojdbc7.jar:
java.sql.SQLException: Could not commit with auto-commit set on
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:4443)
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:4490)
at oracle.jdbc.driver.T4CConnection.doSetAutoCommit(T4CConnection.java:943)
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:4
My app still run normally with classes12.jar.
I researched on oracle:
This exception is raised for any one of the following cases:
- When auto-commit status is set to true and commit or rollback method is called
- When the default status of auto-commit is not changed and commit or rollback method is called
- When the value of the COMMIT_ON_ACCEPT_CHANGES property is true and commit or rollback method is called after calling the acceptChanges method on a rowset
But i couldn't find mistake in my source. Please help me give more explaination about this error.
java oracle jdbc
I just upgrade to new jdbc driver from classes12.jar to ojdbc7.jar
My app threw an exception when was running with ojdbc7.jar:
java.sql.SQLException: Could not commit with auto-commit set on
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:4443)
at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:4490)
at oracle.jdbc.driver.T4CConnection.doSetAutoCommit(T4CConnection.java:943)
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:4
My app still run normally with classes12.jar.
I researched on oracle:
This exception is raised for any one of the following cases:
- When auto-commit status is set to true and commit or rollback method is called
- When the default status of auto-commit is not changed and commit or rollback method is called
- When the value of the COMMIT_ON_ACCEPT_CHANGES property is true and commit or rollback method is called after calling the acceptChanges method on a rowset
But i couldn't find mistake in my source. Please help me give more explaination about this error.
java oracle jdbc
java oracle jdbc
edited Jun 2 '16 at 17:51
Hardik Doshi
421216
421216
asked May 30 '14 at 11:29
scareworkscarework
56112
56112
1
Try settingconnection.setAutoCommit(false);
– user432
May 30 '14 at 11:31
1
Make sure you're using JDK7: that's what the "7" means in "ojdbc7". The classes12.jar is JDK 1.2 vintage - you should have changed years ago. Don't be fooled by "my app still runs normally with classes12.jar". You should not use that ever again.
– duffymo
May 30 '14 at 11:33
Given the callstack I'd suspect a bug in the driver. When switching between autocommittrueandfalse(and vice versa), the driver must commit the active transaction, and it looks like this commit fails because the driver is in autocommit. On the other hand, I'd expect Oracle to thoroughly test their driver for these kind of basic state switches.
– Mark Rotteveel
May 30 '14 at 11:44
@MarkRotteveel: Please look at this question. stackoverflow.com/questions/27272317/… I think my question is related to this thread
– UI_Dev
Dec 3 '14 at 13:24
add a comment |
1
Try settingconnection.setAutoCommit(false);
– user432
May 30 '14 at 11:31
1
Make sure you're using JDK7: that's what the "7" means in "ojdbc7". The classes12.jar is JDK 1.2 vintage - you should have changed years ago. Don't be fooled by "my app still runs normally with classes12.jar". You should not use that ever again.
– duffymo
May 30 '14 at 11:33
Given the callstack I'd suspect a bug in the driver. When switching between autocommittrueandfalse(and vice versa), the driver must commit the active transaction, and it looks like this commit fails because the driver is in autocommit. On the other hand, I'd expect Oracle to thoroughly test their driver for these kind of basic state switches.
– Mark Rotteveel
May 30 '14 at 11:44
@MarkRotteveel: Please look at this question. stackoverflow.com/questions/27272317/… I think my question is related to this thread
– UI_Dev
Dec 3 '14 at 13:24
1
1
Try setting
connection.setAutoCommit(false);– user432
May 30 '14 at 11:31
Try setting
connection.setAutoCommit(false);– user432
May 30 '14 at 11:31
1
1
Make sure you're using JDK7: that's what the "7" means in "ojdbc7". The classes12.jar is JDK 1.2 vintage - you should have changed years ago. Don't be fooled by "my app still runs normally with classes12.jar". You should not use that ever again.
– duffymo
May 30 '14 at 11:33
Make sure you're using JDK7: that's what the "7" means in "ojdbc7". The classes12.jar is JDK 1.2 vintage - you should have changed years ago. Don't be fooled by "my app still runs normally with classes12.jar". You should not use that ever again.
– duffymo
May 30 '14 at 11:33
Given the callstack I'd suspect a bug in the driver. When switching between autocommit
true and false (and vice versa), the driver must commit the active transaction, and it looks like this commit fails because the driver is in autocommit. On the other hand, I'd expect Oracle to thoroughly test their driver for these kind of basic state switches.– Mark Rotteveel
May 30 '14 at 11:44
Given the callstack I'd suspect a bug in the driver. When switching between autocommit
true and false (and vice versa), the driver must commit the active transaction, and it looks like this commit fails because the driver is in autocommit. On the other hand, I'd expect Oracle to thoroughly test their driver for these kind of basic state switches.– Mark Rotteveel
May 30 '14 at 11:44
@MarkRotteveel: Please look at this question. stackoverflow.com/questions/27272317/… I think my question is related to this thread
– UI_Dev
Dec 3 '14 at 13:24
@MarkRotteveel: Please look at this question. stackoverflow.com/questions/27272317/… I think my question is related to this thread
– UI_Dev
Dec 3 '14 at 13:24
add a comment |
4 Answers
4
active
oldest
votes
The latest OJDBC drivers are more compliant then they where. You can turn off this behavior for legacy code:
-Doracle.jdbc.autoCommitSpecCompliant=false
It's a JVM option.
add a comment |
This kind of exceptions occur when the Oracle JDBC Driver (ojdbc6.jar) version 12 or above will be used. Version 12 and above of the driver is more strictly than earlier driver versions.
You can solve the problem, you have few options:
- Change jar file to old version.( Below 12; usually issue occurs while migrating to new server)
Override behavior of new jar version(ojdbc6.jar) with setting below JVM arguments.
-Doracle.jdbc.autoCommitSpecCompliant=false
IBM WAS users, refer this link:
Set Auto Commit off in Java/SQL:
Java:
conn.setAutoCommit(false);
Oracle:
SET AUTOCOMMIT OFF
add a comment |
We are IBM WAS v9 with using ojbc6.jar Above configure applied to APP Server, Node agent and DMGR, then it works.
-Doracle.jdbc.autoCommitSpecCompliant=false
Dmgr:
Deployment manager > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
NodeAgent:
Node agents > nodeagent > Process definition > Java Virtual Machine
WebSphere Application Server:
Application servers > WebSphere_Portal > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
add a comment |
Changing this in Hibernate properties worked for me
hibernate.connection.release_mode=auto
Nothing in the question suggests the OP was using Hibernate.
– Mark Rotteveel
Mar 16 '18 at 8:22
add a comment |
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f23953534%2fjava-sql-sqlexception-could-not-commit-with-auto-commit-set-on-at-oracle-jdbc-d%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
The latest OJDBC drivers are more compliant then they where. You can turn off this behavior for legacy code:
-Doracle.jdbc.autoCommitSpecCompliant=false
It's a JVM option.
add a comment |
The latest OJDBC drivers are more compliant then they where. You can turn off this behavior for legacy code:
-Doracle.jdbc.autoCommitSpecCompliant=false
It's a JVM option.
add a comment |
The latest OJDBC drivers are more compliant then they where. You can turn off this behavior for legacy code:
-Doracle.jdbc.autoCommitSpecCompliant=false
It's a JVM option.
The latest OJDBC drivers are more compliant then they where. You can turn off this behavior for legacy code:
-Doracle.jdbc.autoCommitSpecCompliant=false
It's a JVM option.
answered Nov 26 '14 at 13:45
Olafur TryggvasonOlafur Tryggvason
3,0321725
3,0321725
add a comment |
add a comment |
This kind of exceptions occur when the Oracle JDBC Driver (ojdbc6.jar) version 12 or above will be used. Version 12 and above of the driver is more strictly than earlier driver versions.
You can solve the problem, you have few options:
- Change jar file to old version.( Below 12; usually issue occurs while migrating to new server)
Override behavior of new jar version(ojdbc6.jar) with setting below JVM arguments.
-Doracle.jdbc.autoCommitSpecCompliant=false
IBM WAS users, refer this link:
Set Auto Commit off in Java/SQL:
Java:
conn.setAutoCommit(false);
Oracle:
SET AUTOCOMMIT OFF
add a comment |
This kind of exceptions occur when the Oracle JDBC Driver (ojdbc6.jar) version 12 or above will be used. Version 12 and above of the driver is more strictly than earlier driver versions.
You can solve the problem, you have few options:
- Change jar file to old version.( Below 12; usually issue occurs while migrating to new server)
Override behavior of new jar version(ojdbc6.jar) with setting below JVM arguments.
-Doracle.jdbc.autoCommitSpecCompliant=false
IBM WAS users, refer this link:
Set Auto Commit off in Java/SQL:
Java:
conn.setAutoCommit(false);
Oracle:
SET AUTOCOMMIT OFF
add a comment |
This kind of exceptions occur when the Oracle JDBC Driver (ojdbc6.jar) version 12 or above will be used. Version 12 and above of the driver is more strictly than earlier driver versions.
You can solve the problem, you have few options:
- Change jar file to old version.( Below 12; usually issue occurs while migrating to new server)
Override behavior of new jar version(ojdbc6.jar) with setting below JVM arguments.
-Doracle.jdbc.autoCommitSpecCompliant=false
IBM WAS users, refer this link:
Set Auto Commit off in Java/SQL:
Java:
conn.setAutoCommit(false);
Oracle:
SET AUTOCOMMIT OFF
This kind of exceptions occur when the Oracle JDBC Driver (ojdbc6.jar) version 12 or above will be used. Version 12 and above of the driver is more strictly than earlier driver versions.
You can solve the problem, you have few options:
- Change jar file to old version.( Below 12; usually issue occurs while migrating to new server)
Override behavior of new jar version(ojdbc6.jar) with setting below JVM arguments.
-Doracle.jdbc.autoCommitSpecCompliant=false
IBM WAS users, refer this link:
Set Auto Commit off in Java/SQL:
Java:
conn.setAutoCommit(false);
Oracle:
SET AUTOCOMMIT OFF
answered Jan 21 '17 at 9:04
Rushi DaxiniRushi Daxini
63165
63165
add a comment |
add a comment |
We are IBM WAS v9 with using ojbc6.jar Above configure applied to APP Server, Node agent and DMGR, then it works.
-Doracle.jdbc.autoCommitSpecCompliant=false
Dmgr:
Deployment manager > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
NodeAgent:
Node agents > nodeagent > Process definition > Java Virtual Machine
WebSphere Application Server:
Application servers > WebSphere_Portal > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
add a comment |
We are IBM WAS v9 with using ojbc6.jar Above configure applied to APP Server, Node agent and DMGR, then it works.
-Doracle.jdbc.autoCommitSpecCompliant=false
Dmgr:
Deployment manager > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
NodeAgent:
Node agents > nodeagent > Process definition > Java Virtual Machine
WebSphere Application Server:
Application servers > WebSphere_Portal > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
add a comment |
We are IBM WAS v9 with using ojbc6.jar Above configure applied to APP Server, Node agent and DMGR, then it works.
-Doracle.jdbc.autoCommitSpecCompliant=false
Dmgr:
Deployment manager > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
NodeAgent:
Node agents > nodeagent > Process definition > Java Virtual Machine
WebSphere Application Server:
Application servers > WebSphere_Portal > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
We are IBM WAS v9 with using ojbc6.jar Above configure applied to APP Server, Node agent and DMGR, then it works.
-Doracle.jdbc.autoCommitSpecCompliant=false
Dmgr:
Deployment manager > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
NodeAgent:
Node agents > nodeagent > Process definition > Java Virtual Machine
WebSphere Application Server:
Application servers > WebSphere_Portal > Process definition > Java Virtual Machine
Modify "Generic JVM arguments"
edited Nov 23 '18 at 10:47
answered Nov 23 '18 at 10:32
johnson tsangjohnson tsang
11
11
add a comment |
add a comment |
Changing this in Hibernate properties worked for me
hibernate.connection.release_mode=auto
Nothing in the question suggests the OP was using Hibernate.
– Mark Rotteveel
Mar 16 '18 at 8:22
add a comment |
Changing this in Hibernate properties worked for me
hibernate.connection.release_mode=auto
Nothing in the question suggests the OP was using Hibernate.
– Mark Rotteveel
Mar 16 '18 at 8:22
add a comment |
Changing this in Hibernate properties worked for me
hibernate.connection.release_mode=auto
Changing this in Hibernate properties worked for me
hibernate.connection.release_mode=auto
answered Mar 16 '18 at 8:01
KevinKevin
323412
323412
Nothing in the question suggests the OP was using Hibernate.
– Mark Rotteveel
Mar 16 '18 at 8:22
add a comment |
Nothing in the question suggests the OP was using Hibernate.
– Mark Rotteveel
Mar 16 '18 at 8:22
Nothing in the question suggests the OP was using Hibernate.
– Mark Rotteveel
Mar 16 '18 at 8:22
Nothing in the question suggests the OP was using Hibernate.
– Mark Rotteveel
Mar 16 '18 at 8:22
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f23953534%2fjava-sql-sqlexception-could-not-commit-with-auto-commit-set-on-at-oracle-jdbc-d%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown

1
Try setting
connection.setAutoCommit(false);– user432
May 30 '14 at 11:31
1
Make sure you're using JDK7: that's what the "7" means in "ojdbc7". The classes12.jar is JDK 1.2 vintage - you should have changed years ago. Don't be fooled by "my app still runs normally with classes12.jar". You should not use that ever again.
– duffymo
May 30 '14 at 11:33
Given the callstack I'd suspect a bug in the driver. When switching between autocommit
trueandfalse(and vice versa), the driver must commit the active transaction, and it looks like this commit fails because the driver is in autocommit. On the other hand, I'd expect Oracle to thoroughly test their driver for these kind of basic state switches.– Mark Rotteveel
May 30 '14 at 11:44
@MarkRotteveel: Please look at this question. stackoverflow.com/questions/27272317/… I think my question is related to this thread
– UI_Dev
Dec 3 '14 at 13:24