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:
Richard G. Curtis 2009-12-08 16:03:56 +00:00
parent b831319443
commit d17c70965d
2 changed files with 26 additions and 2 deletions

View File

@ -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")).

View File

@ -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.