简体   繁体   English

尝试针对mysql保存用户应用程序时,WSO2 App Store引发错误

[英]WSO2 App Store throws error when attempting to save a users Application against mysql

API Store is throwing errors when I try to create or edit an application 当我尝试创建或编辑应用程序时,API Store引发错误

java.sql.SQLException: Can't call commit when autocommit=true

I've added the setting of 我已经添加了

init-command='set autocommit=0'

to the my.cnf file 到my.cnf文件

I've also added the flag: 我还添加了标志:

?relaxAutoCommit=true

to the connection string but to no avail. 连接字符串,但无济于事。 I continue to get this error. 我继续收到此错误。

I am using the same mysql database for both the WSO2_CARBON_DB and teh WSO2AM_DB plus I have a single publisher node and two separate store nodes all pointing to the same mysql datasource. 我对WSO2_CARBON_DB和WSO2AM_DB使用相同的mysql数据库,另外我有一个发布者节点和两个单独的存储节点,均指向同一个mysql数据源。

I notice the application edit is saved (or the new application is created) but the exception is still thrown in the console and an error message appears in the user interface (as per the error at the top of this question). 我注意到应用程序编辑已保存(或创建了新应用程序),但控制台中仍会引发异常,并且用户界面中会出现错误消息(根据此问题顶部的错误)。

Is there some other setting, within the WSO2 conf files that I have to tweak in order to get this to work properly? 在WSO2 conf文件中是否还有其他设置需要调整才能使其正常运行?

Add both autoReconnect and relaxAutoCommit flags to the jdbc url of your defined "WSO2AM_DB" datasource in master-datasources.xml file. master-datasources.xml文件中,将autoReconnectrelaxAutoCommit标志都添加到已定义的“ WSO2AM_DB”数据源的jdbc url中。 This will resolve your issue. 这样可以解决您的问题。

<configuration>

<url>jdbc:mysql://localhost:3306/AM_DB?autoReconnect=true&amp;relaxAutoCommit=true</url>

<username>xxxx</username>

<;password>xxxxx</password>

EDIT: I updated the url to reflect the correct syntax for escaping the ampersand. 编辑:我更新了URL以反映转义与号的正确语法。

just for the sake of completeness, the JDBC URL shoud be 仅出于完整性考虑,应将JDBC URL

jdbc:mysql://localhost:3306/WSO2CARBON_DB?autoReconnect=true&amp;relaxAutoCommit=true JDBC:MySQL的://本地主机:3306 / WSO2CARBON_DB autoReconnect的=真安培;了relaxAutoCommit =真

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM