尝试针对 mysql 保存用户应用程序时,WSO2 App Store 引发错误 [英] WSO2 App Store throws error when attempting to save a users Application against mysql

查看:35
本文介绍了尝试针对 mysql 保存用户应用程序时,WSO2 App Store 引发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

API Store 在我尝试创建或编辑应用程序时抛出错误

java.sql.SQLException: 当 autocommit=true 时不能调用 commit

我已经添加了

的设置

init-command='set autocommit=0'

到 my.cnf 文件

我还添加了标志:

?relaxAutoCommit=true

到连接字符串但无济于事.我继续收到此错误.

我对 WSO2_CARBON_DB 和 WSO2AM_DB 使用相同的 mysql 数据库,而且我有一个发布者节点和两个单独的存储节点,它们都指向同一个 mysql 数据源.

我注意到应用程序编辑已保存(或新应用程序已创建),但控制台中仍抛出异常,并且用户界面中出现错误消息(根据此问题顶部的错误).

在 WSO2 conf 文件中是否还有其他设置,我必须对其进行调整才能使其正常工作?

解决方案

autoReconnectrelaxAutoCommit 标志添加到您在 <中定义的WSO2AM_DB"数据源的 jdbc url代码>master-datasources.xml 文件.这将解决您的问题.

<预><代码><配置><url>jdbc:mysql://localhost:3306/AM_DB?autoReconnect=true&amp;relaxAutoCommit=true</url><用户名>xxxx</用户名><;密码>xxxxx</密码>

我更新了 url 以反映转义符的正确语法.

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?

解决方案

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.

这篇关于尝试针对 mysql 保存用户应用程序时,WSO2 App Store 引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆