当 Worklight DB 关闭时,Worklight 控制台上的启用访问禁用消息

Enable Access Disable message on Worklight console when Worklight DB is down

我正在尝试在 worlight 控制台上添加访问禁用消息 post 我的数据库将因某些活动而停止,我是否仍然能够向我的最终用户显示来自 worklight 控制台的访问禁用消息。还是我的应用程序会完全停止工作,无论如何我可以测试这个。

停止 mysql 数据库后的日志。

[ERROR   ] FWLSE0081E: Failed synchronizing application from database. [project testApp]
Could not open JPA EntityManager for transaction; nested exception is <openjpa-1.2.2-r422266:898935 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Communications link failure

The last packet successfully received from the server was 19 milliseconds ago.  The last packet sent successfully to the server was 18 milliseconds ago.
[ERROR   ] FWLSE0074E: Failed synchronizing adapters from database. [project testApp]
Could not open JPA EntityManager for transaction; nested exception is <openjpa-1.2.2-r422266:898935 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Communications link failure

The last packet successfully received from the server was 0 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.
[ERROR   ] FWLSE0188E: Failed to connect to MYSQL database : Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. [project testApp]
[ERROR   ] Connection to the database failed
Connection to the database failed
[ERROR   ] FWLSE0188E: Failed to connect to MYSQL database : Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. [project testApp]
[ERROR   ] FWLSE0081E: Failed synchronizing application from database. [project testApp]
Could not open JPA EntityManager for transaction; nested exception is <openjpa-1.2.2-r422266:898935 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
[ERROR   ] FWLSE0188E: Failed to connect to MYSQL database : Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. [project testApp]
[ERROR   ] FWLSE0074E: Failed synchronizing adapters from database. [project testApp]
Could not open JPA EntityManager for transaction; nested exception is <openjpa-1.2.2-r422266:898935 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

屏幕截图 djrecker

如果服务器的数据库出现故障,您甚至无法访问您的控制台,因此您也将无法设置您的远程禁用规则。应用程序将尝试连接到服务器并失败。

如果您在 Worklight Server 前面有一些 HTTP 服务器,例如负载平衡器等,它可以配置为 return 一些状态代码。您应该能够检测到此状态代码并向最终用户显示适当的消息。

我在这里进一步描述:

  1. 尝试在带有消息的 Worklight 控制台上添加访问禁用 需要
  2. 停止数据库服务器/实例
  3. 尝试打开您的应用并将其终止,将显示通用访问禁用消息。
  4. 此外,如果 DB 已关闭,Worklight 控制台仍可从 浏览器,但您的应用程序将不可见。
  5. 重新启动数据库并刷新控制台后,您的应用程序将在 Worklight 控制台上加载
  6. 在步骤 1 中添加的访问禁用消息将 按原样保留并显示在应用程序上
  7. 如果您没有在第 1 步添加访问禁用消息并且数据库已停止,您将看到如下屏幕截图所示的一般消息,每次加载应用程序时都会看到此信息