1
我的項目出現問題。當我用庫連接到數據庫時,會發生問題。java.sql.SQLException:您不能使用自動提交集進行回滾
該庫具有下面的代碼:
PreparedStatement stmt = null;
try {
con.setAutoCommit(true);
stmt = con.prepareStatement(this.sqlIniBD);
stmt.setString(1, id);
stmt.executeUpdate();
} catch (Throwable t) {
if (this.tavi.activo()) this.tavi.escribir(toString(), "No se ha podido insertar la fila inicial para las claves de encriptacion (" + id + "). Posiblemente ya existe: " + t);
}
我要問你,如果有任何可能把autoCommit(false)
,在我standalone.xml
。也許這很奇怪或愚蠢。這是數據源,例如:
<datasource jta="false" jndi-name="java:/xxx" pool-name="xxx" enabled="true" use-ccm="false">
<connection-url>jdbc:oracle:thin:@oradag.cm.es:1524:oradag1</connection-url>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<connection-property name="autoCommit">
<!-- not working -->false
</connection-property>
<driver>ojdbc7.jar</driver>
<security>
<user-name>xxx</user-name>
<password>xxx</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<timeout>
<set-tx-query-timeout>false</set-tx-query-timeout>
<blocking-timeout-millis>0</blocking-timeout-millis>
<idle-timeout-minutes>0</idle-timeout-minutes>
<query-timeout>0</query-timeout>
<use-try-lock>0</use-try-lock>
<allocation-retry>0</allocation-retry>
<allocation-retry-wait-millis>0</allocation-retry-wait-millis>
</timeout>
<statement>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
任何想法?我無法修改庫,我沒有代碼。
所以我唯一的希望在於standalone.xml
。
您在JBoss中或WildFly或類似的東西的工作? –
14:58:12,349 INFO [org.jboss.as](MSC服務線程1-6)JBAS015899:JBoss EAP 6.3.0.GA(AS 7.4.0.Final-redhat-19)iniciando – Dekker
這正是mi jboss的版本 – Dekker