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

时间秒杀一切 提交于 2019-12-10 22:21:48

问题


API Store is throwing errors when I try to create or edit an application

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

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.

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?


回答1:


Add both autoReconnect and relaxAutoCommit flags to the jdbc url of your defined "WSO2AM_DB" datasource in master-datasources.xml file. 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.




回答2:


just for the sake of completeness, the JDBC URL shoud be

jdbc:mysql://localhost:3306/WSO2CARBON_DB?autoReconnect=true&amp;relaxAutoCommit=true



来源:https://stackoverflow.com/questions/13476915/wso2-app-store-throws-error-when-attempting-to-save-a-users-application-against

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!