From 03d19774c2c6a63b49a3b95f5b3095af146015b3 Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Wed, 3 Oct 2007 14:09:43 +0000 Subject: [PATCH] OPENJPA-366 - Add message text to InternalException. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@581608 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/openjpa/kernel/BrokerImpl.java | 2 +- .../org/apache/openjpa/kernel/localizer.properties | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java index e0053967e..3a924b45b 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java @@ -1733,7 +1733,7 @@ public class BrokerImpl detachAllInternal(null); } if (_operationCount < 1) - throw new InternalException(); + throw new InternalException(_loc.get("multi-threaded-access")); return _operationCount == 1; } catch (OpenJPAException ke) { throw ke; diff --git a/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties b/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties index cbe1dbad0..201cf62cd 100644 --- a/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties +++ b/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties @@ -374,4 +374,8 @@ provided via an initializer or by calling the setter method. You either need \ to remove the @GeneratedValue annotation or modify the code to remove the \ initializer processing. invalid-tran-status: The transaction was not in a valid state ({0}) to \ -accept the "{1}" method invocation. Processing will continue. \ No newline at end of file +accept the "{1}" method invocation. Processing will continue. +multi-threaded-access: Multiple concurrent threads attempted to access a \ + single broker. By default brokers are not thread safe, if you require \ + and/or intent a broker to be accessed by more then one thread, set the \ + openjpa.Multithreaded property to true to override the default behavior.