mirror of
https://github.com/apache/openjpa.git
synced 2025-03-07 00:49:39 +00:00
OPENJPA-1415: Suppress batched OLE messages.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@888453 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b831319443
commit
d17c70965d
@ -229,6 +229,7 @@ public class BrokerImpl
|
||||
private boolean _orderDirty = false;
|
||||
private boolean _cachePreparedQuery = true;
|
||||
private boolean _cacheFinderQuery = true;
|
||||
private boolean _suppressBatchOLELogging = false;
|
||||
|
||||
// status
|
||||
private int _flags = 0;
|
||||
@ -836,6 +837,23 @@ public class BrokerImpl
|
||||
_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
|
||||
///////////
|
||||
@ -2235,8 +2253,13 @@ public class BrokerImpl
|
||||
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")).
|
||||
|
@ -404,6 +404,7 @@ 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.
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user