How to set auto-commit to false for all the DataSource connections
Issue
-
How can i set the auto-commit=false for all the connections available inside the DataSource? When an application gets a connection from the DataSource, I want the retrieved connection to be set to
auto-commit=false
mode by default -
I tried adding the following connection property in my
oracle-ds.xml
, but it does not work.
<connection-property name="autoCommit">false</connection-property>
- I am getting
Caused by: java.sql.SQLException: You cannot commit with autocommit set!
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:1039)
at org.jboss.jca.adapters.jdbc.WrappedConnection.commit(WrappedConnection.java:757)
Environment
- JBoss Enterprise Application Platform (EAP)
- 4.3
- 5.x
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.