openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r888449 - in /openjpa/branches/1.2.x/openjpa-kernel/src/main: java/org/apache/openjpa/kernel/BrokerImpl.java resources/org/apache/openjpa/kernel/localizer.properties
Date Tue, 08 Dec 2009 15:48:31 GMT
Author: curtisr7
Date: Tue Dec  8 15:48:31 2009
New Revision: 888449

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

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

Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=888449&r1=888448&r2=888449&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
(original)
+++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
Tue Dec  8 15:48:31 2009
@@ -220,6 +220,7 @@
     private int _detachState = DETACH_LOADED;
     private boolean _detachedNew = true;
     private boolean _orderDirty = false;
+    private boolean _suppressBatchOLELogging = false;
 
     // status
     private int _flags = 0;
@@ -759,6 +760,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
     ///////////
@@ -2157,8 +2175,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.2.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties?rev=888449&r1=888448&r2=888449&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
(original)
+++ openjpa/branches/1.2.x/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties
Tue Dec  8 15:48:31 2009
@@ -399,4 +399,5 @@
 cant-serialize-connected-broker: Serialization not allowed for brokers with \
     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.
\ No newline at end of file
+fetch-configuration-stack-empty: Fetch configuration stack is empty.
+broker-suppressing-exceptions: Suppressing "{0}" exceptions.



Mime
View raw message