Hi all,

Since I increase the sensibility of error message [1], we have on different screen that take some time to rendering an  error throw due to transaction timeout.

By default each screen is rendering with the default timeout (60s) that isn't enough when you have big data compilation or some external service latency.

Of course it's possible to analyze each case with purpose to increase the screen velocity or set a transaction-timeout on screen definition, but as first easy step what do you think if we add a default transaction timeout for screen to 10 minutes with possibility to override by properties ?

Example:

*****************************

framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreen.java
@@ -122,7 +123,7 @@ public class ModelScreen extends ModelWidget {
         // wrap the whole screen rendering in a transaction, should improve performance in querying and such          Map<String, String> parameters = UtilGenerics.cast(context.get("parameters"));
         boolean beganTransaction = false;
-        int transactionTimeout = -1;
+        int transactionTimeout = UtilProperties.getPropertyAsInteger("widget", "widget.transaction.timeout.default", 600);
         if (parameters != null) {
             String transactionTimeoutPar = parameters.get("TRANSACTION_TIMEOUT");
             if (transactionTimeoutPar != null) {
@@ -152,12 +153,7 @@ public class ModelScreen extends ModelWidget {
             // If transaction timeout is present, use it to start the transaction              // If transaction timeout is set to zero, no transaction is started
             if (useTransaction) {
-                if (transactionTimeout < 0) {
-                    beganTransaction = TransactionUtil.begin();
-                }
-                if (transactionTimeout > 0) {
-                    beganTransaction = TransactionUtil.begin(transactionTimeout);
-                }
+                beganTransaction = TransactionUtil.begin(transactionTimeout);
             }

             // render the screen, starting with the top-level section

*******************************

Any remarks ?

In parallel i will investigate why the error message catch is so sensible.

Nicolas

[1] http://svn.apache.org/viewvc?view=revision&revision=1856175

--
logoNrd <https://nereide.fr/>
        Nicolas Malin
The apache way <http://theapacheway.com/> : *Charity* Apache’s mission is providing software for the public good.
[email protected]
8 rue des Déportés 37000 TOURS, 02 47 50 30 54

Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way <http://theapacheway.com/>|réseau LE <http://www.libre-entreprise.org/>

Reply via email to