1 | |
package org.apache.ojb.odmg; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
import org.odmg.LockNotGrantedException; |
19 | |
import org.apache.ojb.broker.PersistenceBroker; |
20 | |
import org.apache.ojb.broker.Identity; |
21 | |
import org.apache.ojb.broker.PersistenceBrokerException; |
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
public class NarrowTransaction implements TransactionExt |
29 | |
{ |
30 | |
private TransactionImpl tx; |
31 | |
|
32 | |
public NarrowTransaction(TransactionImpl tx) |
33 | |
{ |
34 | |
this.tx = tx; |
35 | |
} |
36 | |
|
37 | |
public TransactionImpl getRealTransaction() |
38 | |
{ |
39 | |
return tx; |
40 | |
} |
41 | |
|
42 | |
public void markDelete(Object anObject) |
43 | |
{ |
44 | |
this.tx.markDelete(anObject); |
45 | |
} |
46 | |
|
47 | |
public void markDirty(Object anObject) |
48 | |
{ |
49 | |
this.tx.markDirty(anObject); |
50 | |
} |
51 | |
|
52 | |
public void flush() |
53 | |
{ |
54 | |
tx.flush(); |
55 | |
} |
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
public PersistenceBroker getBroker() |
61 | |
{ |
62 | |
return tx.getBroker(); |
63 | |
} |
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
public void join() |
69 | |
{ |
70 | |
throw new UnsupportedOperationException("Not supported operation"); |
71 | |
} |
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
public void leave() |
77 | |
{ |
78 | |
throw new UnsupportedOperationException("Not supported operation"); |
79 | |
} |
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
public void begin() |
85 | |
{ |
86 | |
throw new UnsupportedOperationException("Not supported operation"); |
87 | |
} |
88 | |
|
89 | |
|
90 | |
|
91 | |
|
92 | |
public boolean isOpen() |
93 | |
{ |
94 | |
return tx.isOpen(); |
95 | |
} |
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
public void commit() |
101 | |
{ |
102 | |
throw new UnsupportedOperationException("Not supported operation"); |
103 | |
} |
104 | |
|
105 | |
|
106 | |
|
107 | |
|
108 | |
public void abort() |
109 | |
{ |
110 | |
tx.abort(); |
111 | |
|
112 | |
} |
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
public void checkpoint() |
118 | |
{ |
119 | |
throw new UnsupportedOperationException("Not supported operation"); |
120 | |
} |
121 | |
|
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | |
public void lock(Object obj, int lockMode) |
127 | |
throws LockNotGrantedException |
128 | |
{ |
129 | |
tx.lock(obj, lockMode); |
130 | |
} |
131 | |
|
132 | |
|
133 | |
|
134 | |
|
135 | |
|
136 | |
public boolean tryLock(Object obj, int lockMode) |
137 | |
{ |
138 | |
return tx.tryLock(obj, lockMode); |
139 | |
} |
140 | |
|
141 | |
public Object getObjectByIdentity(Identity id) |
142 | |
throws PersistenceBrokerException |
143 | |
{ |
144 | |
return tx.getObjectByIdentity(id); |
145 | |
} |
146 | |
|
147 | |
|
148 | |
|
149 | |
public void setImplicitLocking(boolean value) |
150 | |
{ |
151 | |
tx.setImplicitLocking(value); |
152 | |
} |
153 | |
|
154 | |
|
155 | |
|
156 | |
|
157 | |
public boolean isImplicitLocking() |
158 | |
{ |
159 | |
return tx.isImplicitLocking(); |
160 | |
} |
161 | |
|
162 | |
|
163 | |
|
164 | |
|
165 | |
public void setCascadingDelete(Class target, String referenceField, boolean doCascade) |
166 | |
{ |
167 | |
tx.setCascadingDelete(target, referenceField, doCascade); |
168 | |
} |
169 | |
|
170 | |
|
171 | |
|
172 | |
|
173 | |
public void setCascadingDelete(Class target, boolean doCascade) |
174 | |
{ |
175 | |
tx.setCascadingDelete(target, doCascade); |
176 | |
} |
177 | |
|
178 | |
public boolean isOrdering() |
179 | |
{ |
180 | |
return tx.isOrdering(); |
181 | |
} |
182 | |
|
183 | |
public void setOrdering(boolean ordering) |
184 | |
{ |
185 | |
tx.setOrdering(ordering); |
186 | |
} |
187 | |
|
188 | |
|
189 | |
|
190 | |
|
191 | |
|
192 | |
|
193 | |
|
194 | |
|
195 | |
|
196 | |
|
197 | |
|
198 | |
public boolean isDeleted(Identity id) |
199 | |
{ |
200 | |
return tx.isDeleted(id); |
201 | |
} |
202 | |
} |