Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039446Retail ModulesWeb POSpublic2018-04-13 10:152018-10-18 17:16
egoitz 
marvintm 
normalmajoralways
closedfixed 
5
 
RR18Q3.2 
migueldejuana
No
0039446: 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 10:36marvintmTypedesign defect => backport
2018-10-15 10:36marvintmTarget Version => RR18Q3.2
2018-10-16 17:08martinsdanIssue Monitored: martinsdan
2018-10-18 09:44hgbotCheckin
2018-10-18 09:44hgbotNote Added: 0107385
2018-10-18 09:44hgbotCheckin
2018-10-18 09:44hgbotNote Added: 0107386
2018-10-18 09:44hgbotStatusscheduled => resolved
2018-10-18 09:44hgbotResolutionopen => fixed
2018-10-18 09:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR18Q3.2/rev/319737990b14756658cb513bbcf5fd7b0a3cef05 [^]
2018-10-18 09:44hgbotCheckin
2018-10-18 09:44hgbotNote Added: 0107387
2018-10-18 09:48hgbotCheckin
2018-10-18 09:48hgbotNote Added: 0107389
2018-10-18 09:48hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/backports/3.0PR18Q3.2/rev/319737990b14756658cb513bbcf5fd7b0a3cef05 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.retail.posterminal/rev/3ade0146c01d79bd066fec63b9952721f1787de3 [^]
2018-10-18 10:21hgbotCheckin
2018-10-18 10:21hgbotNote Added: 0107399
2018-10-18 10:21hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.retail.posterminal/rev/3ade0146c01d79bd066fec63b9952721f1787de3 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/fb6472ec07910d2a89b9b80604073dbf10ac23d4 [^]
2018-10-18 10:21hgbotCheckin
2018-10-18 10:21hgbotNote Added: 0107400
2018-10-18 10:21hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/fb6472ec07910d2a89b9b80604073dbf10ac23d4 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/d400265ea59541c1221eee8dd26f4fdd599ee7f1 [^]
2018-10-18 10:21hgbotCheckin
2018-10-18 10:21hgbotNote Added: 0107401
2018-10-18 10:21hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/d400265ea59541c1221eee8dd26f4fdd599ee7f1 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/0ef8e020aa1643551e1293eae7eb2ebde2a887a4 [^]
2018-10-18 10:21hgbotCheckin
2018-10-18 10:21hgbotNote Added: 0107402
2018-10-18 10:21hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/0ef8e020aa1643551e1293eae7eb2ebde2a887a4 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/14c39c1a6d47f78b3d9786eea6683fb0d823aedc [^]
2018-10-18 10:21hgbotCheckin
2018-10-18 10:21hgbotNote Added: 0107403
2018-10-18 10:21hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/14c39c1a6d47f78b3d9786eea6683fb0d823aedc [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/e921d8a23d252aa2be9ba1605d738457ce32e70e [^]
2018-10-18 10:21hgbotCheckin
2018-10-18 10:21hgbotNote Added: 0107404
2018-10-18 10:21hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/e921d8a23d252aa2be9ba1605d738457ce32e70e [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/233363fde0ce84d88a1492a712b7305497328d5b [^]
2018-10-18 10:21hgbotCheckin
2018-10-18 10:21hgbotNote Added: 0107405
2018-10-18 10:21hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/233363fde0ce84d88a1492a712b7305497328d5b [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core/rev/a1d001aae7c6a3a7402544bf3403d2eb5fd74a21 [^]
2018-10-18 10:21hgbotCheckin
2018-10-18 10:21hgbotNote Added: 0107406
2018-10-18 10:21hgbotCheckin
2018-10-18 10:21hgbotNote Added: 0107407
2018-10-18 10:31hgbotCheckin
2018-10-18 10:31hgbotNote Added: 0107410
2018-10-18 10:31hgbotCheckin
2018-10-18 10:31hgbotNote Added: 0107411
2018-10-18 12:33hgbotCheckin
2018-10-18 12:33hgbotNote Added: 0107432
2018-10-18 17:16migueldejuanaReview Assigned To => migueldejuana
2018-10-18 17:16migueldejuanaNote Added: 0107445
2018-10-18 17:16migueldejuanaStatusresolved => closed

Notes
(0107385)
hgbot   
2018-10-18 09:44   
Repository: erp/backports/3.0PR18Q3.2
Changeset: 98d6ff8f62af4f22de25bfe75942015e975c5de2
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 09:39:16 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.2/rev/98d6ff8f62af4f22de25bfe75942015e975c5de2 [^]

Related to issue 39446. Backport hasNoConnections method.

---
M modules/org.openbravo.apachejdbcconnectionpool/src/org/openbravo/apachejdbcconnectionpool/JdbcExternalConnectionPool.java
M src-core/src/org/openbravo/database/ExternalConnectionPool.java
---
(0107386)
hgbot   
2018-10-18 09:44   
Repository: erp/backports/3.0PR18Q3.2
Changeset: 319737990b14756658cb513bbcf5fd7b0a3cef05
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 09:43:32 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.2/rev/319737990b14756658cb513bbcf5fd7b0a3cef05 [^]

Fixed issue 39446 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
---
(0107387)
hgbot   
2018-10-18 09:44   
Repository: erp/backports/3.0PR18Q3.2
Changeset: c6dc68fccff2cde583a7cf5aeeb3d5a543b06a5e
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 09:43:51 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.2/rev/c6dc68fccff2cde583a7cf5aeeb3d5a543b06a5e [^]

Related to issue 39446. Improved comment and log.

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---
(0107389)
hgbot   
2018-10-18 09:48   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.retail.posterminal
Changeset: 3ade0146c01d79bd066fec63b9952721f1787de3
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 09:48:45 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q3.2/org.openbravo.retail.posterminal/rev/3ade0146c01d79bd066fec63b9952721f1787de3 [^]

Fixed issue 39446. 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
---
(0107399)
hgbot   
2018-10-18 10:21   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core
Changeset: fb6472ec07910d2a89b9b80604073dbf10ac23d4
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.0RR18Q3.2/org.openbravo.mobile.core/rev/fb6472ec07910d2a89b9b80604073dbf10ac23d4 [^]

Fixed issue 39446. 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
---
(0107400)
hgbot   
2018-10-18 10:21   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core
Changeset: d400265ea59541c1221eee8dd26f4fdd599ee7f1
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.0RR18Q3.2/org.openbravo.mobile.core/rev/d400265ea59541c1221eee8dd26f4fdd599ee7f1 [^]

Fixed issue 39446. 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
---
(0107401)
hgbot   
2018-10-18 10:21   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core
Changeset: 0ef8e020aa1643551e1293eae7eb2ebde2a887a4
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.0RR18Q3.2/org.openbravo.mobile.core/rev/0ef8e020aa1643551e1293eae7eb2ebde2a887a4 [^]

Fixed issue 39446. 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
---
(0107402)
hgbot   
2018-10-18 10:21   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core
Changeset: 14c39c1a6d47f78b3d9786eea6683fb0d823aedc
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.0RR18Q3.2/org.openbravo.mobile.core/rev/14c39c1a6d47f78b3d9786eea6683fb0d823aedc [^]

Fixed issue 39446. 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
---
(0107403)
hgbot   
2018-10-18 10:21   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core
Changeset: e921d8a23d252aa2be9ba1605d738457ce32e70e
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.0RR18Q3.2/org.openbravo.mobile.core/rev/e921d8a23d252aa2be9ba1605d738457ce32e70e [^]

Fixed issue 39446. 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
---
(0107404)
hgbot   
2018-10-18 10:21   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core
Changeset: 233363fde0ce84d88a1492a712b7305497328d5b
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.0RR18Q3.2/org.openbravo.mobile.core/rev/233363fde0ce84d88a1492a712b7305497328d5b [^]

Fixed issue 39446. 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
---
(0107405)
hgbot   
2018-10-18 10:21   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core
Changeset: a1d001aae7c6a3a7402544bf3403d2eb5fd74a21
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.0RR18Q3.2/org.openbravo.mobile.core/rev/a1d001aae7c6a3a7402544bf3403d2eb5fd74a21 [^]

Fixed issue 39446. 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
---
(0107406)
hgbot   
2018-10-18 10:21   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core
Changeset: 24fd6cbd278c11fe2893c1ab3c7656a78a629201
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.0RR18Q3.2/org.openbravo.mobile.core/rev/24fd6cbd278c11fe2893c1ab3c7656a78a629201 [^]

Related to issue 39446. Applied formatter.

---
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
---
(0107407)
hgbot   
2018-10-18 10:21   
Repository: retail/backports/3.0RR18Q3.2/org.openbravo.mobile.core
Changeset: 047c94c8895d4b7a2f7dece668762014b2184536
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.0RR18Q3.2/org.openbravo.mobile.core/rev/047c94c8895d4b7a2f7dece668762014b2184536 [^]

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

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0107410)
hgbot   
2018-10-18 10:31   
Repository: erp/backports/3.0PR18Q3.2
Changeset: 7dc62a036b50af1540fd87bbbb439593eb62c8f6
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 10:30:27 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.2/rev/7dc62a036b50af1540fd87bbbb439593eb62c8f6 [^]

Related to issue 39446. 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
---
(0107411)
hgbot   
2018-10-18 10:31   
Repository: erp/backports/3.0PR18Q3.2
Changeset: 4312cc454a6cf3c2d5d674f88b770bec0fa67ae0
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Oct 18 10:31:32 2018 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.2/rev/4312cc454a6cf3c2d5d674f88b770bec0fa67ae0 [^]

Related to issue 39446. Backport hasNoConnections method.

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

Related to issue 39446. Change to comply with Java7

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