Lines 18-23
import org.eclipse.persistence.descriptors.ClassDescriptor;
Link Here
|
18 |
import org.eclipse.persistence.exceptions.ValidationException; |
18 |
import org.eclipse.persistence.exceptions.ValidationException; |
19 |
import org.eclipse.persistence.indirection.*; |
19 |
import org.eclipse.persistence.indirection.*; |
20 |
import org.eclipse.persistence.mappings.*; |
20 |
import org.eclipse.persistence.mappings.*; |
|
|
21 |
import org.eclipse.persistence.queries.ObjectLevelReadQuery; |
21 |
import org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder; |
22 |
import org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder; |
22 |
import org.eclipse.persistence.internal.sessions.AbstractSession; |
23 |
import org.eclipse.persistence.internal.sessions.AbstractSession; |
23 |
import org.eclipse.persistence.internal.sessions.UnitOfWorkImpl; |
24 |
import org.eclipse.persistence.internal.sessions.UnitOfWorkImpl; |
Lines 56-61
public abstract class UnitOfWorkValueHolder extends DatabaseValueHolder implemen
Link Here
|
56 |
protected transient Object relationshipSourceObject; |
57 |
protected transient Object relationshipSourceObject; |
57 |
protected String sourceAttributeName; |
58 |
protected String sourceAttributeName; |
58 |
protected ObjID wrappedValueHolderRemoteID; |
59 |
protected ObjID wrappedValueHolderRemoteID; |
|
|
60 |
|
61 |
/** |
62 |
* Determine whether a refresh should be allowed on this valueholder during a cascade. |
63 |
* Refresh is allowed when in the same UnitOfWork as the initial refresh was called on |
64 |
*/ |
65 |
protected boolean allowRefresh = false; |
59 |
|
66 |
|
60 |
protected UnitOfWorkValueHolder(ValueHolderInterface attributeValue, Object clone, DatabaseMapping mapping, UnitOfWorkImpl unitOfWork) { |
67 |
protected UnitOfWorkValueHolder(ValueHolderInterface attributeValue, Object clone, DatabaseMapping mapping, UnitOfWorkImpl unitOfWork) { |
61 |
this.wrappedValueHolder = attributeValue; |
68 |
this.wrappedValueHolder = attributeValue; |
Lines 149-154
public abstract class UnitOfWorkValueHolder extends DatabaseValueHolder implemen
Link Here
|
149 |
} |
156 |
} |
150 |
unitOfWork.log(SessionLog.FINEST, SessionLog.TRANSACTION, "instantiate_pl_relationship"); |
157 |
unitOfWork.log(SessionLog.FINEST, SessionLog.TRANSACTION, "instantiate_pl_relationship"); |
151 |
} |
158 |
} |
|
|
159 |
/* if (!isAllowRefresh() && wrapped instanceof QueryBasedValueHolder){ |
160 |
QueryBasedValueHolder qbvh = ((QueryBasedValueHolder)wrapped); |
161 |
if (qbvh.getQuery().isObjectLevelReadQuery()){ |
162 |
((ObjectLevelReadQuery)qbvh.getQuery()).setShouldRefreshIdentityMapResult(false); |
163 |
} |
164 |
}*/ |
152 |
if (unitOfWork.getCommitManager().isActive() || unitOfWork.wasTransactionBegunPrematurely()) { |
165 |
if (unitOfWork.getCommitManager().isActive() || unitOfWork.wasTransactionBegunPrematurely()) { |
153 |
// At this point the wrapped valueholder is not triggered, |
166 |
// At this point the wrapped valueholder is not triggered, |
154 |
// and we are in transaction. So just trigger the |
167 |
// and we are in transaction. So just trigger the |
Lines 162-167
public abstract class UnitOfWorkValueHolder extends DatabaseValueHolder implemen
Link Here
|
162 |
} |
175 |
} |
163 |
|
176 |
|
164 |
/** |
177 |
/** |
|
|
178 |
* Determine whether a refresh should be allowed on this valueholder during a cascade. |
179 |
* Refresh is allowed when in the same UnitOfWork as the initial refresh was called on |
180 |
*/ |
181 |
public boolean isAllowRefresh() { |
182 |
return allowRefresh; |
183 |
} |
184 |
|
185 |
|
186 |
/** |
165 |
* INTERNAL: |
187 |
* INTERNAL: |
166 |
* Answers if this valueholder is easy to instantiate. |
188 |
* Answers if this valueholder is easy to instantiate. |
167 |
* @return true if getValue() won't trigger a database read. |
189 |
* @return true if getValue() won't trigger a database read. |
Lines 268-273
public abstract class UnitOfWorkValueHolder extends DatabaseValueHolder implemen
Link Here
|
268 |
//do nothing. nothing should be reset to null; |
290 |
//do nothing. nothing should be reset to null; |
269 |
} |
291 |
} |
270 |
|
292 |
|
|
|
293 |
/** |
294 |
* Set whether a refresh should be allowed on this valueholder during a cascade. |
295 |
* Refresh is allowed when in the same UnitOfWork as the initial refresh was called on |
296 |
*/ |
297 |
public void setAllowRefresh(boolean allowRefresh) { |
298 |
this.allowRefresh = allowRefresh; |
299 |
} |
300 |
|
271 |
public void setBackupValueHolder(ValueHolder backupValueHolder) { |
301 |
public void setBackupValueHolder(ValueHolder backupValueHolder) { |
272 |
this.backupValueHolder = backupValueHolder; |
302 |
this.backupValueHolder = backupValueHolder; |
273 |
} |
303 |
} |