Payara 5 - 在执行此操作之前应将 Statement Wrapping 设置为 true

Payara 5 - Statement Wrapping should be set to true before performing this operation

在 Payara 5 中,我在尝试 运行

时收到 "Statement Wrapping should be set to true before performing this operation"
"./asadmin set resources.jdbc-connection-pool.mysql_MY-DB-NAME_rootPool.max-wait-time-in-millis=604800"

简而言之:

./asadmin set resources.jdbc-connection-pool.mysql_MY-DB-NAME_rootPool.max-wait-time-in-millis=604800

Enter admin user name>  MY_ADMIN_USER
Enter admin password for user "MY_ADMIN_USER">

remote failure: Could not change the attributes: Constraints for this JdbcConnectionPool configuration have been violated: on property [  ] violation reason [ Statement Wrapping should be set to true before performing this operation ]
Constraints for this JdbcConnectionPool configuration have been violated: on property [  ] violation reason [ Statement Wrapping should be set to true before performing this operation ]
Command set failed

有人知道这条错误信息是什么意思吗?

这意味着您必须先在连接池上启用 "wrap-jdbc-objects" 选项,然后才能设置另一个 属性。在 domain.xml 中执行此操作

  <jdbc-connection-pool
        name="my-conn-pool"
        wrap-jdbc-objects="true" ...>

还有一个等效的 asadmin 命令。

看起来约束只在 Payara 5 中强制执行,在早期版本中它没有产生这个错误。

这似乎也在 Payara 4.1.2.181 中强制执行,因为在 4.1.2.172 中不需要它