Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039451Retail ModulesWeb POSpublic2018-04-13 10:152018-10-18 17:16
egoitz 
marvintm 
normalmajoralways
closedfixed 
5
 
RR18Q2.4 
migueldejuana
No
0039451: The terminal does not go to offline mode if the database is colapsed but the tomcat works
If for example, the database get out of connections, the webpos does not go offline.
-Access to a terminal
-Stop postgresql.
-Refresh the application.
*It tryies to login but then you are continuosly requested to login again.
OFFLINE does not work
No tags attached.
blocks design defect 0038361 closed marvintm The terminal does not go to offline mode if the database is colapsed but the tomcat works 
Issue History
2018-10-15 15:22marvintmTypedesign defect => backport
2018-10-15 15:22marvintmTarget Version => RR18Q2.4
2018-10-18 09:42hgbotCheckin
2018-10-18 09:42hgbotNote Added: 0107382
2018-10-18 09:42hgbotCheckin
2018-10-18 09:42hgbotNote Added: 0107383
2018-10-18 09:43hgbotStatusscheduled => resolved
2018-10-18 09:43hgbotResolutionopen => fixed
2018-10-18 09:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/a16a113b5f65ce8cc671f1bead1a54a8b569bc52 [^] => http://code.openbravo.com/erp/backports/3.0PR18Q2.3/rev/246fcd88bb39c4dd81a770ba29c254dc9ede25e0 [^]
2018-10-18 09:43hgbotCheckin
2018-10-18 09:43hgbotNote Added: 0107384
2018-10-18 09:48hgbotCheckin
2018-10-18 09:48hgbotNote Added: 0107388
2018-10-18 09:48hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/backports/3.0PR18Q2.3/rev/246fcd88bb39c4dd81a770ba29c254dc9ede25e0 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal/rev/21d5d99e5fbcccf3675c14b0bce8f2f8fe1fb115 [^]
2018-10-18 10:18hgbotCheckin
2018-10-18 10:18hgbotNote Added: 0107390
2018-10-18 10:18hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal/rev/21d5d99e5fbcccf3675c14b0bce8f2f8fe1fb115 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/79702b137ed23f2bf9e540d8695d2aabba106cd0 [^]
2018-10-18 10:18hgbotCheckin
2018-10-18 10:18hgbotNote Added: 0107391
2018-10-18 10:18hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/79702b137ed23f2bf9e540d8695d2aabba106cd0 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/eb5c4cc58800e32237eb5c84abec6bbf86cfedd5 [^]
2018-10-18 10:18hgbotCheckin
2018-10-18 10:18hgbotNote Added: 0107392
2018-10-18 10:18hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/eb5c4cc58800e32237eb5c84abec6bbf86cfedd5 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/ffc6e764e0ccb6061e9a55c4e6f4c6ce4afd330a [^]
2018-10-18 10:18hgbotCheckin
2018-10-18 10:18hgbotNote Added: 0107393
2018-10-18 10:18hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/ffc6e764e0ccb6061e9a55c4e6f4c6ce4afd330a [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/4f19e7222b1e6f5e056a872c6e7897a7937846a1 [^]
2018-10-18 10:18hgbotCheckin
2018-10-18 10:18hgbotNote Added: 0107394
2018-10-18 10:18hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/4f19e7222b1e6f5e056a872c6e7897a7937846a1 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/dcdfdc18a66dcd88a2f7a7dee471de481d5e7440 [^]
2018-10-18 10:18hgbotCheckin
2018-10-18 10:18hgbotNote Added: 0107395
2018-10-18 10:18hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/dcdfdc18a66dcd88a2f7a7dee471de481d5e7440 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/e2b7f541e06f06164eefb17b590ae0286a7d3b7e [^]
2018-10-18 10:18hgbotCheckin
2018-10-18 10:18hgbotNote Added: 0107396
2018-10-18 10:18hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/e2b7f541e06f06164eefb17b590ae0286a7d3b7e [^] => http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/db5f7463a75734c9e7366a0be7c5a9e519064751 [^]
2018-10-18 10:18hgbotCheckin
2018-10-18 10:18hgbotNote Added: 0107397
2018-10-18 10:18hgbotCheckin
2018-10-18 10:18hgbotNote Added: 0107398
2018-10-18 10:25hgbotCheckin
2018-10-18 10:25hgbotNote Added: 0107408
2018-10-18 10:29hgbotCheckin
2018-10-18 10:29hgbotNote Added: 0107409
2018-10-18 12:32hgbotCheckin
2018-10-18 12:32hgbotNote Added: 0107431
2018-10-18 17:16migueldejuanaReview Assigned To => migueldejuana
2018-10-18 17:16migueldejuanaNote Added: 0107446
2018-10-18 17:16migueldejuanaStatusresolved => closed

Notes
(0107382)
hgbot   
2018-10-18 09:42   
Repository: erp/backports/3.0PR18Q2.3
Changeset: 1ab9d0c20167afa7830db5de162e507ccf968c8c
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 09:38:45 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q2.3/rev/1ab9d0c20167afa7830db5de162e507ccf968c8c [^]

Related to issue 39451. Backport hasNoConnections method.

---
M modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/JdbcExternalConnectionPool.java
M src-core/src/org/openbravo/database/ExternalConnectionPool.java
---
(0107383)
hgbot   
2018-10-18 09:42   
Repository: erp/backports/3.0PR18Q2.3
Changeset: 246fcd88bb39c4dd81a770ba29c254dc9ede25e0
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 09:41:55 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q2.3/rev/246fcd88bb39c4dd81a770ba29c254dc9ede25e0 [^]

Fixed issue 39451. The terminal does not go to offline mode if the database is colapsed but the tomcat works
When there is an exception in the critical part of the HttpSecureAppServlet which tries to detect if the client is authenticated, we should not necessarily force a logout and reply with '401- Not authenticated' response. Instead, the appropriate action is to just return a '500-Internal Server Error' response. Logging out in this case may kill a valid request when the server is temporarily overloaded, and makes no sense, and the 401 response may confuse the client, thinking that it needs to do login again when in reality, the problem is just that the server is either overloaded, or affected by some serious problem which prevents even basic authentication checking to work.

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---
(0107384)
hgbot   
2018-10-18 09:43   
Repository: erp/backports/3.0PR18Q2.3
Changeset: 204b57dc92f8f37d632b320382fc7667ee482c78
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 09:42:36 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q2.3/rev/204b57dc92f8f37d632b320382fc7667ee482c78 [^]

Related to issue 39451. Improved comment and log.

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---
(0107388)
hgbot   
2018-10-18 09:48   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal
Changeset: 21d5d99e5fbcccf3675c14b0bce8f2f8fe1fb115
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 09:48:15 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.retail.posterminal/rev/21d5d99e5fbcccf3675c14b0bce8f2f8fe1fb115 [^]

Fixed issue 39451. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Two changes have been made:
- In the main Terminal request, if the response is not a known message, then most probably it is a critical error which happened in the server when trying to compute the terminal. In this case, it is better to try to force an offline login than block the process, as this may otherwise make it impossible to do an offline login in the system when the server is affected by some serious problem.
- In the loginUtils request, if the request fails with an unexpected error, we will try to continue with the main flow to allow an offline login to be completed.

---
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
---
(0107390)
hgbot   
2018-10-18 10:18   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: 79702b137ed23f2bf9e540d8695d2aabba106cd0
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:25:04 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/79702b137ed23f2bf9e540d8695d2aabba106cd0 [^]

Fixed issue 39451. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Added some basic check with a database query. Modified the response to ensure that it follows a correct format.

---
M src/org/openbravo/mobile/core/login/CheckServerAvailability.java
---
(0107391)
hgbot   
2018-10-18 10:18   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: eb5c4cc58800e32237eb5c84abec6bbf86cfedd5
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:27:03 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/eb5c4cc58800e32237eb5c84abec6bbf86cfedd5 [^]

Fixed issue 39451. The terminal does not go to offline mode if the database is colapsed but the tomcat works
If server ran out of connections, we will generate an '500-Internal Server Error'. Otherwise, if it's just a normal Exception, we assume that it is a plain defect in functional code which should not be considered cause of a general server problem, and will return a standard error with a 200 response.

---
M src/org/openbravo/mobile/core/login/MobileCoreLoginUtilsServlet.java
---
(0107392)
hgbot   
2018-10-18 10:18   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: ffc6e764e0ccb6061e9a55c4e6f4c6ce4afd330a
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:28:07 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/ffc6e764e0ccb6061e9a55c4e6f4c6ce4afd330a [^]

Fixed issue 39451. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Do not catch Throwables, we just let them leak to super classes, in which they will be handled correctly (will still return '500 Internal Server error' in this case)

---
M src/org/openbravo/mobile/core/process/MobileService.java
---
(0107393)
hgbot   
2018-10-18 10:18   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: 4f19e7222b1e6f5e056a872c6e7897a7937846a1
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:28:46 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/4f19e7222b1e6f5e056a872c6e7897a7937846a1 [^]

Fixed issue 39451. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Do not catch Throwables, we just let them leak to super classes, in which they will be handled correctly (will still return '500 Internal Server error' in this case).

---
M src/org/openbravo/mobile/core/process/WebServiceAbstractServlet.java
---
(0107394)
hgbot   
2018-10-18 10:18   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: dcdfdc18a66dcd88a2f7a7dee471de481d5e7440
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:30:22 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/dcdfdc18a66dcd88a2f7a7dee471de481d5e7440 [^]

Fixed issue 39451. The terminal does not go to offline mode if the database is colapsed but the tomcat works
> Avoid setting wrong (unauthorized) state, in case HttpSecureAppServlet was affected by an exception in a critical part, and returned a 500 state

---
M src/org/openbravo/mobile/core/process/WebServiceAuthenticatedServlet.java
---
(0107395)
hgbot   
2018-10-18 10:18   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: e2b7f541e06f06164eefb17b590ae0286a7d3b7e
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:31:33 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/e2b7f541e06f06164eefb17b590ae0286a7d3b7e [^]

Fixed issue 39451. The terminal does not go to offline mode if the database is colapsed but the tomcat works
Ensure transitionToOnline counter correctly resets to the next step, in case of CheckServerAvailability error.

---
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
---
(0107396)
hgbot   
2018-10-18 10:18   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: db5f7463a75734c9e7366a0be7c5a9e519064751
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 11 18:32:22 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/db5f7463a75734c9e7366a0be7c5a9e519064751 [^]

Fixed issue 39451. The terminal does not go to offline mode if the database is colapsed but the tomcat works
When doing offline login ensure that when connectedToERP variable changes due to the load of the Terminal object from cache, this doesn't affect the rest of the login process.

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0107397)
hgbot   
2018-10-18 10:18   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: cec0400b14bb12591036fe8660a56ac1755b3533
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Sat Oct 13 19:02:46 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/cec0400b14bb12591036fe8660a56ac1755b3533 [^]

Related to issue 39451. Applied formatter.

---
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
---
(0107398)
hgbot   
2018-10-18 10:18   
Repository: retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core
Changeset: 53716df9f399768681582889d245b72adfd5ddf6
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Tue Oct 16 14:15:30 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q2.4/org.openbravo.mobile.core/rev/53716df9f399768681582889d245b72adfd5ddf6 [^]

Related to issue 39451. Language will not be reset if response is invalid.

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0107408)
hgbot   
2018-10-18 10:25   
Repository: erp/backports/3.0PR18Q2.3
Changeset: bb5bb2c5a986efde037943e1ae7ca485a08ca9ba
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 10:25:39 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q2.3/rev/bb5bb2c5a986efde037943e1ae7ca485a08ca9ba [^]

Related to issue 39451. Backout hasNoConnections method implementation, will be replaced by a Java7 compliant version

---
M modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/JdbcExternalConnectionPool.java
M src-core/src/org/openbravo/database/ExternalConnectionPool.java
---
(0107409)
hgbot   
2018-10-18 10:29   
Repository: erp/backports/3.0PR18Q2.3
Changeset: e828f42d336fafb5c613783444d2cf10d72f9695
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 10:29:10 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q2.3/rev/e828f42d336fafb5c613783444d2cf10d72f9695 [^]

Related to issue 39451. Backport hasNoConnections method.

---
M modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/JdbcExternalConnectionPool.java
M src-core/src/org/openbravo/database/ExternalConnectionPool.java
---
(0107431)
hgbot   
2018-10-18 12:32   
Repository: erp/backports/3.0PR18Q2.3
Changeset: 3bcc7cfdacb06ef1cd58f8e8e09dda6632d71935
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 12:32:31 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q2.3/rev/3bcc7cfdacb06ef1cd58f8e8e09dda6632d71935 [^]

Related to issue 39451. Change to comply with Java7

---
M modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/JdbcExternalConnectionPool.java
---
(0107446)
migueldejuana   
2018-10-18 17:16   
Tested and reviewed