The "Could not commit with auto-commit set on" exception happens when the connection is automatically set auto commit to true.
To fix this, do one of the followings.
Class.forName(<dbDriver>);
Connection connection = DriverManager.getConnection(<dbURL>, <dbUser>, <dbPassword>);
connection.setAutoCommit(false);
In NetBeans, right click the project, select Properties. In the pop up window, select Run on the left and enter -Doracle.jdbc.autoCommitSpecCompliant=false in the VM Options on the right.
--------------------------------------------------------------------------------
If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book free here.
To fix this, do one of the followings.
A. Set connection to auto commit false.
Class.forName(<dbDriver>);
Connection connection = DriverManager.getConnection(<dbURL>, <dbUser>, <dbPassword>);
connection.setAutoCommit(false);
B. Set the -Doracle.jdbc.autoCommitSpecCompliant=false JVM option.
In NetBeans, right click the project, select Properties. In the pop up window, select Run on the left and enter -Doracle.jdbc.autoCommitSpecCompliant=false in the VM Options on the right.
--------------------------------------------------------------------------------
If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book free here.
No comments:
Post a Comment