openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r888455 - in /openjpa/branches/1.3.x/openjpa-kernel/src/main: java/org/apache/openjpa/kernel/BrokerImpl.java resources/org/apache/openjpa/kernel/localizer.properties
Date Tue, 08 Dec 2009 16:05:58 GMT
Author: curtisr7
Date: Tue Dec  8 16:05:57 2009
New Revision: 888455

URL: http://svn.apache.org/viewvc?rev=888455&view=rev
Log:
OPENJPA-1415: Suppress batched OLE messages.

Modified:
    openjpa/branches/1.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
    openjpa/branches/1.3.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties

Modified: openjpa/branches/1.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=888455&r1=888454&r2=888455&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
(original)
+++ openjpa/branches/1.3.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
Tue Dec  8 16:05:57 2009
@@ -221,6 +221,7 @@
     private int _detachState = DETACH_LOADED;
     private boolean _detachedNew = true;
     private boolean _orderDirty = false;
+    private boolean _suppressBatchOLELogging = false;
 
     // status
     private int _flags = 0;
@@ -760,6 +761,23 @@
                 _transCallbackMode);
     }
 
+    /**
+     * Set whether this Broker will generate verbose optimistic lock exceptions when batching
+     * operations. Defaults to true.
+     * 
+     * @param b
+     */
+    public void setSuppressBatchOLELogging(boolean b) {
+        _suppressBatchOLELogging = b;
+    }
+    
+    /**
+     * Return whether this Broker will generate verbose optimistic lock exceptions when batching
+     * operations.
+     */
+    public boolean getSuppressBatchOLELogging() {
+        return _suppressBatchOLELogging;
+    }
     ///////////
     // Lookups
     ///////////
@@ -2159,8 +2177,13 @@
                     failed.add(f);
             }
         }
-        if (opt && !failed.isEmpty())
-            return new OptimisticException(failed, t);
+        if (opt && !failed.isEmpty()) {
+            if(_suppressBatchOLELogging == true){
+                return new OptimisticException(_loc.get("broker-suppressing-exceptions",t.length));
+            }else{
+                return new OptimisticException(failed, t);
+            }
+        }
         if (opt)
             return new OptimisticException(t);
         return new StoreException(_loc.get("rolled-back")).

Modified: openjpa/branches/1.3.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/branches/1.3.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties?rev=888455&r1=888454&r2=888455&view=diff
==============================================================================
--- openjpa/branches/1.3.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
(original)
+++ openjpa/branches/1.3.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
Tue Dec  8 16:05:57 2009
@@ -400,6 +400,7 @@
     an active connection to the database.
 no-interface-metadata: No metadata was found for managed interface {0}.
 fetch-configuration-stack-empty: Fetch configuration stack is empty.
+broker-suppressing-exceptions: Suppressing "{0}" exceptions.
 gap-query-param: Parameter {1} for query "{0}" exceeds the number of {2} \
 	bound parameters with following values "{3}". This can happen if you have \
 	declared but missed to bind values for one or more parameters.



Mime
View raw message