01: /**
02: * Copyright (C) 2006 NetMind Consulting Bt.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 3 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package hu.netmind.persistence;
18:
19: /**
20: * Exception is thrown, if an object is about to be saved in a transaction,
21: * but the same object (or another representation of the same data) is under
22: * modification in another thread. This exception is also thrown if one
23: * of the objects is already locked.
24: * @author Brautigam Robert
25: * @version Revision: $Revision$
26: */
27: public class ConcurrentModificationException extends StoreException {
28: private SessionInfo sessionInfo;
29: private Object[] objs;
30:
31: public ConcurrentModificationException(SessionInfo sessionInfo,
32: Object[] objs, String message) {
33: super (message);
34: this .sessionInfo = sessionInfo;
35: this .objs = objs;
36: }
37:
38: public ConcurrentModificationException(SessionInfo sessionInfo,
39: Object[] objs, String message, Throwable cause) {
40: super (message, cause);
41: this .sessionInfo = sessionInfo;
42: this .objs = objs;
43: }
44:
45: /**
46: * Returns the object which could not be modified.
47: */
48: public Object[] getObjects() {
49: return objs;
50: }
51:
52: /**
53: * Returns the transaction which currently locks the object that could
54: * not be modified.
55: */
56: public SessionInfo getSessionInfo() {
57: return sessionInfo;
58: }
59: }
|