svn commit: r750068 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r750068 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java

jleroux@apache.org
Author: jleroux
Date: Wed Mar  4 16:39:17 2009
New Revision: 750068

URL: http://svn.apache.org/viewvc?rev=750068&view=rev
Log:
Just keep the comment, in case someone one day wants to implement the counter idea
This closes "ServerHit aborts transactions when trying to create entries with duplicate startTime(s)." https://issues.apache.org/jira/browse/OFBIZ-2208 OFBIZ-2208

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java?rev=750068&r1=750067&r2=750068&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java Wed Mar  4 16:39:17 2009
@@ -651,6 +651,22 @@
                 Debug.logError("Unable to get localhost internet address: " + e.toString(), module);
             }
 
+            // The problem with
+            //
+            //     serverHit.create();
+            //
+            // is that if there are two requests with the same startTime (this should only happen with MySQL see https://issues.apache.org/jira/browse/OFBIZ-2208)
+            // then this will go wrong and abort the actual
+            // transaction we are interested in.
+            // Another way instead of using create is to store or update,
+            // that is overwrite in case there already was an entry, thus
+            // avoiding the transaction being aborted which is not
+            // less desirable than having multiple requests with the
+            // same startTime overwriting each other.
+            // This may not satisfy those who want to record each and
+            // every server hit even with equal startTimes but that could be
+            // solved adding a counter to the ServerHit's PK (a counter
+            // counting multiple hits at the same startTime).            
             try {
                 serverHit.create();
             } catch (GenericEntityException e) {