【发布时间】:2015-01-27 03:06:11
【问题描述】:
我刚刚完成了作为核心开发人员的 hybris 培训。我已经完成了所有的路径,并且很快就会有一个项目,但现在我想稍微调整一下系统以了解更多信息。我的意思是我想将数据库更改为 MySQL,但是当我在 hybris 平台上更改这些文件 project.properties 和 local.properties 上的设置时。
但问题是,当我再次尝试运行 hybris 服务器时,它给了我一个异常,如下所示:
【问题讨论】:
我刚刚完成了作为核心开发人员的 hybris 培训。我已经完成了所有的路径,并且很快就会有一个项目,但现在我想稍微调整一下系统以了解更多信息。我的意思是我想将数据库更改为 MySQL,但是当我在 hybris 平台上更改这些文件 project.properties 和 local.properties 上的设置时。
但问题是,当我再次尝试运行 hybris 服务器时,它给了我一个异常,如下所示:
【问题讨论】:
如果您想连接到 MySQL,您只需更改 hybris/config/local.properties 中的配置。
db.url=jdbc:mysql://localhost/hybris
db.driver=com.mysql.jdbc.Driver
db.username=anything but not "root"
db.password=
mysql.allow.fractional.seconds=true (if you're using MySQL 5.6.4 or later)
自 hybris Commerce Suite 版本 5.0.2 起,MySQL 连接器未随 hybris Commerce Suite 一起提供。请下载file并将其放入文件夹${HYBRIS_BIN_DIR}/platform/lib/dbdriver
v6 更新
现在mysql.allow.fractional.seconds=true 已经存在于平台的 project.properties 中。
为了避免锁,你可以在 mysql 配置中添加:
transaction_isolation=READ-COMMITTED
innodb_autoinc_lock_mode = 2
innodb_locks_unsafe_for_binlog=1
【讨论】:
ant clean all 然后运行 ant initialize?
This flag allows to create datetime columns which support fractional seconds. For more information, see https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-4.html With MySQL 5.6.4 (or later) the mysql.allow.fractional.seconds property must be defined. Otherwise java.util.Date columns may behave in the strange way of date values getting rounded up ( means into the future ) instead of being truncated.
不要忘记使用“ant all”构建服务器。如果不构建服务器,则不会应用配置。
【讨论】: