View | Details | Raw Unified | Return to bug 257270 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/emf/cdo/CDOView.java (-97 / +107 lines)
Lines 64-74 Link Here
64
public interface CDOView extends CDOProtocolView, INotifier
64
public interface CDOView extends CDOProtocolView, INotifier
65
{
65
{
66
  /**
66
  /**
67
   * @since 2.0
68
   */
69
  public static final int NO_REVISION_PREFETCHING = 1;
70
71
  /**
72
   * Returns the {@link CDOSession session} this view was opened by.
67
   * Returns the {@link CDOSession session} this view was opened by.
73
   * 
68
   * 
74
   * @return The session this view was opened by, or <code>null</code> if this view is closed.
69
   * @return The session this view was opened by, or <code>null</code> if this view is closed.
Lines 168-265 Link Here
168
  public boolean hasConflict();
163
  public boolean hasConflict();
169
164
170
  /**
165
  /**
171
   * Sets the type of references to be used in the internal object cache to either {@link ReferenceType#STRONG STRONG},
172
   * {@link ReferenceType#SOFT SOFT} or {@link ReferenceType#WEAK WEAK}. If <code>null</code> is passed the default
173
   * reference type {@link ReferenceType#SOFT SOFT} is set. If the given reference type does not differ from the one
174
   * being currently set the new value is ignored and <code>false</code> is returned. Otherwise existing object
175
   * references are converted to the new type and <code>true</code> is returned.
176
   * 
177
   * @since 2.0
178
   */
179
  public boolean setCacheReferenceType(ReferenceType referenceType);
180
181
  /**
182
   * Returns <code>true</code> if the {@link CDOObject objects} in this view will notify their
183
   * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are <em>invalidated</em> (due to
184
   * remote changes), <code>false</code> otherwise.
185
   * 
186
   * @see CDOInvalidationNotification
187
   * @since 2.0
188
   */
189
  public boolean isInvalidationNotificationEnabled();
190
191
  /**
192
   * Specifies whether the {@link CDOObject objects} in this view will notify their
193
   * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are <em>invalidated</em> (due to
194
   * remote changes) or not.
195
   * 
196
   * @see CDOInvalidationNotification
197
   * @since 2.0
198
   */
199
  public void setInvalidationNotificationEnabled(boolean enabled);
200
201
  /**
202
   * Returns the current {@link CDOAdapterPolicy change subscription policy}.
203
   * 
204
   * @return The current change subscription policy, never <code>null</code>.
205
   * @see #setChangeSubscriptionPolicy(CDOAdapterPolicy)
206
   * @since 2.0
207
   */
208
  public CDOAdapterPolicy getChangeSubscriptionPolicy();
209
210
  /**
211
   * Specifies the change subscription policy. By default, the value is set to {@link CDOAdapterPolicy#NONE}.
212
   * <p>
213
   * To activate the policy, you must do the following: <br>
214
   * <code>view.setChangeSubscriptionPolicy(CDOChangeSubscriptionPolicy.ALL);</code>
215
   * <p>
216
   * To register an object, you must add an adapter to the object in which you are interested:<br>
217
   * <code>eObject.eAdapters().add(myAdapter);</code>
218
   * <p>
219
   * By activating this feature, each object having at least one adapter that matches the current policy will be
220
   * registered with the server and will be notified for each change occurring in the scope of any other transaction.
221
   * <p>
222
   * {@link CDOAdapterPolicy#NONE} - Disabled. <br>
223
   * {@link CDOAdapterPolicy#ALL} - Enabled for all adapters used.<br>
224
   * {@link CDOAdapterPolicy#ONLY_CDO_ADAPTER} - Enabled only for adapters that implement {@link CDOAdapter}. <br>
225
   * Any other class that implement {@link CDOAdapterPolicy} will enable for whatever rules defined in that class. <br>
226
   * <p>
227
   * If <code>myAdapter</code> in the above example matches the current policy, <code>eObject</code> will be registered
228
   * with the server and you will receive all changes from other transaction.
229
   * <p>
230
   * When the policy is changed all objects in the cache will automatically be recalculated.
231
   * <p>
232
   * You can subscribe to temporary objects. Even if you cannot receive notifications from other {@link CDOTransaction}
233
   * for these because they are only local to you, at commit time these objects will be registered automatically.
234
   * <p>
235
   * <b>Note:</b> It can be used with <code>CDOSession.setPassiveUpdate(false)</code>. In this case, it will receive
236
   * changes without having the objects changed.
237
   * 
238
   * @since 2.0
239
   */
240
  public void setChangeSubscriptionPolicy(CDOAdapterPolicy policy);
241
242
  /**
243
   * @since 2.0
244
   */
245
  public CDOAdapterPolicy getStrongReferencePolicy();
246
247
  /**
248
   * @since 2.0
249
   */
250
  public void setStrongReferencePolicy(CDOAdapterPolicy policy);
251
252
  /**
253
   * @since 2.0
254
   */
255
  public CDORevisionPrefetchingPolicy getRevisionPrefetchingPolicy();
256
257
  /**
258
   * @since 2.0
259
   */
260
  public void setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy);
261
262
  /**
263
   * Returns <code>true</code> if a resource with the given path exists in the repository, <code>false</code>.
166
   * Returns <code>true</code> if a resource with the given path exists in the repository, <code>false</code>.
264
   * 
167
   * 
265
   * @see #getResource(String, boolean)
168
   * @see #getResource(String, boolean)
Lines 379-382 Link Here
379
   * @since 2.0
282
   * @since 2.0
380
   */
283
   */
381
  public CDOQuery createQuery(String language, String queryString);
284
  public CDOQuery createQuery(String language, String queryString);
285
286
  /**
287
   * @since 2.0
288
   */
289
  public Options options();
290
291
  /**
292
   * @author Simon McDuff
293
   * @since 2.0
294
   */
295
  public interface Options
296
  {
297
    /**
298
     */
299
    public static final int NO_REVISION_PREFETCHING = 1;
300
301
    /**
302
     * Returns the reference type to be used in the internal object cache.
303
     * 
304
     * @return Either {@link ReferenceType#STRONG STRONG}, {@link ReferenceType#SOFT SOFT} or {@link ReferenceType#WEAK
305
     *         WEAK}.
306
     */
307
    public ReferenceType getCacheReferenceType();
308
309
    /**
310
     * Sets the reference type to be used in the internal object cache to either {@link ReferenceType#STRONG STRONG},
311
     * {@link ReferenceType#SOFT SOFT} or {@link ReferenceType#WEAK WEAK}. If <code>null</code> is passed the default
312
     * reference type {@link ReferenceType#SOFT SOFT} is set. If the given reference type does not differ from the one
313
     * being currently set the new value is ignored and <code>false</code> is returned. Otherwise existing object
314
     * references are converted to the new type and <code>true</code> is returned.
315
     */
316
    public boolean setCacheReferenceType(ReferenceType referenceType);
317
318
    /**
319
     * Returns <code>true</code> if the {@link CDOObject objects} in this view will notify their
320
     * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are <em>invalidated</em> (due to
321
     * remote changes), <code>false</code> otherwise.
322
     * 
323
     * @see CDOInvalidationNotification
324
     */
325
    public boolean isInvalidationNotificationEnabled();
326
327
    /**
328
     * Specifies whether the {@link CDOObject objects} in this view will notify their
329
     * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are <em>invalidated</em> (due to
330
     * remote changes) or not.
331
     * 
332
     * @see CDOInvalidationNotification
333
     */
334
    public void setInvalidationNotificationEnabled(boolean enabled);
335
336
    /**
337
     * Returns the current {@link CDOAdapterPolicy change subscription policy}.
338
     * 
339
     * @return The current change subscription policy, never <code>null</code>.
340
     * @see #setChangeSubscriptionPolicy(CDOAdapterPolicy)
341
     */
342
    public CDOAdapterPolicy getChangeSubscriptionPolicy();
343
344
    /**
345
     * Specifies the change subscription policy. By default, the value is set to {@link CDOAdapterPolicy#NONE}.
346
     * <p>
347
     * To activate the policy, you must do the following: <br>
348
     * <code>view.setChangeSubscriptionPolicy(CDOChangeSubscriptionPolicy.ALL);</code>
349
     * <p>
350
     * To register an object, you must add an adapter to the object in which you are interested:<br>
351
     * <code>eObject.eAdapters().add(myAdapter);</code>
352
     * <p>
353
     * By activating this feature, each object having at least one adapter that matches the current policy will be
354
     * registered with the server and will be notified for each change occurring in the scope of any other transaction.
355
     * <p>
356
     * {@link CDOAdapterPolicy#NONE} - Disabled. <br>
357
     * {@link CDOAdapterPolicy#ALL} - Enabled for all adapters used.<br>
358
     * {@link CDOAdapterPolicy#ONLY_CDO_ADAPTER} - Enabled only for adapters that implement {@link CDOAdapter}. <br>
359
     * Any other class that implement {@link CDOAdapterPolicy} will enable for whatever rules defined in that class.
360
     * <br>
361
     * <p>
362
     * If <code>myAdapter</code> in the above example matches the current policy, <code>eObject</code> will be
363
     * registered with the server and you will receive all changes from other transaction.
364
     * <p>
365
     * When the policy is changed all objects in the cache will automatically be recalculated.
366
     * <p>
367
     * You can subscribe to temporary objects. Even if you cannot receive notifications from other
368
     * {@link CDOTransaction} for these because they are only local to you, at commit time these objects will be
369
     * registered automatically.
370
     * <p>
371
     * <b>Note:</b> It can be used with <code>CDOSession.setPassiveUpdate(false)</code>. In this case, it will receive
372
     * changes without having the objects changed.
373
     */
374
    public void setChangeSubscriptionPolicy(CDOAdapterPolicy policy);
375
376
    /**
377
     */
378
    public CDOAdapterPolicy getStrongReferencePolicy();
379
380
    /**
381
     */
382
    public void setStrongReferencePolicy(CDOAdapterPolicy policy);
383
384
    /**
385
     */
386
    public CDORevisionPrefetchingPolicy getRevisionPrefetchingPolicy();
387
388
    /**
389
     */
390
    public void setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy);
391
  }
382
}
392
}
(-)src/org/eclipse/emf/cdo/CDOSession.java (-50 / +56 lines)
Lines 29-61 Link Here
29
  /**
29
  /**
30
   * @since 2.0
30
   * @since 2.0
31
   */
31
   */
32
  public CDOSessionProtocol getProtocol();
32
  public Repository repository();
33
34
  public boolean isOpen();
35
36
  public String getRepositoryName();
37
38
  public String getRepositoryUUID();
39
40
  /**
41
   * @since 2.0
42
   */
43
  public long getRepositoryCreationTime();
44
33
45
  /**
34
  /**
46
   * @since 2.0
35
   * @since 2.0
47
   */
36
   */
48
  public long getRepositoryTime();
37
  public CDOSessionProtocol getProtocol();
49
50
  /**
51
   * @since 2.0
52
   */
53
  public long getRepositoryTime(boolean forceRefresh);
54
55
  /**
56
   * @since 2.0
57
   */
58
  public boolean isRepositorySupportingAudits();
59
38
60
  public CDOPackageRegistry getPackageRegistry();
39
  public CDOPackageRegistry getPackageRegistry();
61
40
Lines 63-95 Link Here
63
42
64
  public CDORevisionManager getRevisionManager();
43
  public CDORevisionManager getRevisionManager();
65
44
66
  /**
67
   * @since 2.0
68
   */
69
  public CDOCollectionLoadingPolicy getCollectionLoadingPolicy();
70
71
  /**
72
   * @since 2.0
73
   */
74
  public void setCollectionLoadingPolicy(CDOCollectionLoadingPolicy policy);
75
76
  /**
77
   * Specifies whether objects will be invalidated due by other users changes.
78
   * <p>
79
   * E.g.: <code>session.setPassiveUpdateEnabled(false);</code>
80
   * <p>
81
   * By default this property is enabled. If this property is disabled the latest versions of objects can still be
82
   * obtained by calling {@link #refresh()}.
83
   * <p>
84
   * Passive update can be disabled in cases where more performance is needed and/or more control over when objects will
85
   * be refreshed.
86
   * <p>
87
   * When enabled again, a refresh will be automatically performed to be in sync with the server.
88
   * 
89
   * @since 2.0
90
   */
91
  public void setPassiveUpdateEnabled(boolean enabled);
92
93
  public CDOView[] getViews();
45
  public CDOView[] getViews();
94
46
95
  public CDOTransaction openTransaction(ResourceSet resourceSet);
47
  public CDOTransaction openTransaction(ResourceSet resourceSet);
Lines 114-117 Link Here
114
   * @since 2.0
66
   * @since 2.0
115
   */
67
   */
116
  public Collection<CDOTimeStampContext> refresh();
68
  public Collection<CDOTimeStampContext> refresh();
69
70
  /**
71
   * @since 2.0
72
   */
73
  public CDOSession.Options options();
74
75
  /**
76
   * @author Simon McDuff
77
   * @since 2.0
78
   */
79
  public interface Options extends CDOProtocolSession.Options
80
  {
81
    /**
82
     * Specifies whether objects will be invalidated due by other users changes.
83
     * <p>
84
     * E.g.: <code>session.setPassiveUpdateEnabled(false);</code>
85
     * <p>
86
     * By default this property is enabled. If this property is disabled the latest versions of objects can still be
87
     * obtained by calling {@link #refresh()}.
88
     * <p>
89
     * Passive update can be disabled in cases where more performance is needed and/or more control over when objects
90
     * will be refreshed.
91
     * <p>
92
     * When enabled again, a refresh will be automatically performed to be in sync with the server.
93
     */
94
    public void setPassiveUpdateEnabled(boolean enabled);
95
96
    /**
97
     */
98
    public CDOCollectionLoadingPolicy getCollectionLoadingPolicy();
99
100
    /**
101
     */
102
    public void setCollectionLoadingPolicy(CDOCollectionLoadingPolicy policy);
103
  }
104
105
  /**
106
   * @author Eike Stepper
107
   * @since 2.0
108
   */
109
  public interface Repository
110
  {
111
    public String getName();
112
113
    public String getUUID();
114
115
    public long getCreationTime();
116
117
    public long getCurrentTime();
118
119
    public long getCurrentTime(boolean forceRefresh);
120
121
    public boolean isSupportingAudits();
122
  }
117
}
123
}
(-)src/org/eclipse/emf/cdo/CDOTransaction.java (-28 / +34 lines)
Lines 32-65 Link Here
32
 */
32
 */
33
public interface CDOTransaction extends CDOView, CDOUserTransaction
33
public interface CDOTransaction extends CDOView, CDOUserTransaction
34
{
34
{
35
  public static final long DEFAULT_COMMIT_TIMEOUT = 100000L;
36
37
  public long getCommitTimeout();
38
39
  public void setCommitTimeout(long timeout);
40
41
  /**
42
   * Specifies whether locks in this view will be removed when {@link CDOTransaction#commit()} or
43
   * {@link CDOTransaction#rollback()} is called.
44
   * <p>
45
   * If false all locks are kept.
46
   * <p>
47
   * Default value is true.
48
   * 
49
   * @since 2.0
50
   */
51
  public boolean setAutoReleaseLocksEnabled(boolean on);
52
53
  /**
54
   * Returns true if locks in this view will be removes when {@link CDOTransaction#commit()} or
55
   * {@link CDOTransaction#rollback()} is called.
56
   * <p>
57
   * Default value is true.
58
   * 
59
   * @since 2.0
60
   */
61
  public boolean isAutoReleaseLocksEnabled();
62
63
  /**
35
  /**
64
   * @since 2.0
36
   * @since 2.0
65
   */
37
   */
Lines 109-112 Link Here
109
   * @since 2.0
81
   * @since 2.0
110
   */
82
   */
111
  public Map<CDOID, CDOObject> getDetachedObjects();
83
  public Map<CDOID, CDOObject> getDetachedObjects();
84
85
  /**
86
   * @since 2.0
87
   */
88
  public CDOTransaction.Options options();
89
90
  /**
91
   * @author Simon McDuff
92
   * @since 2.0
93
   */
94
  public interface Options extends CDOView.Options
95
  {
96
    /**
97
     * Returns true if locks in this view will be removes when {@link CDOTransaction#commit()} or
98
     * {@link CDOTransaction#rollback()} is called.
99
     * <p>
100
     * Default value is true.
101
     * 
102
     * @since 2.0
103
     */
104
    public boolean isAutoReleaseLocksEnabled();
105
106
    /**
107
     * Specifies whether locks in this view will be removed when {@link CDOTransaction#commit()} or
108
     * {@link CDOTransaction#rollback()} is called.
109
     * <p>
110
     * If false all locks are kept.
111
     * <p>
112
     * Default value is true.
113
     * 
114
     * @since 2.0
115
     */
116
    public boolean setAutoReleaseLocksEnabled(boolean on);
117
  }
112
}
118
}
(-)src/org/eclipse/emf/cdo/CDOSessionConfiguration.java (-2 / +2 lines)
Lines 36-47 Link Here
36
  public void setConnector(IConnector connector);
36
  public void setConnector(IConnector connector);
37
37
38
  /**
38
  /**
39
   * @see CDOSession#getRepositoryName()
39
   * @see CDOSession#getName()
40
   */
40
   */
41
  public String getRepositoryName();
41
  public String getRepositoryName();
42
42
43
  /**
43
  /**
44
   * @see CDOSession#getRepositoryName()
44
   * @see CDOSession#getName()
45
   */
45
   */
46
  public void setRepositoryName(String repositoryName);
46
  public void setRepositoryName(String repositoryName);
47
47
(-)src/org/eclipse/emf/internal/cdo/CDOViewImpl.java (-5 / +36 lines)
Lines 171-176 Link Here
171
  /**
171
  /**
172
   * @since 2.0
172
   * @since 2.0
173
   */
173
   */
174
  public Options options()
175
  {
176
    return this;
177
  }
178
179
  /**
180
   * @since 2.0
181
   */
174
  public InternalCDOViewSet getViewSet()
182
  public InternalCDOViewSet getViewSet()
175
  {
183
  {
176
    return viewSet;
184
    return viewSet;
Lines 550-563 Link Here
550
    CDOFeature nodesFeature = resourceFolderClass.getCDONodesFeature();
558
    CDOFeature nodesFeature = resourceFolderClass.getCDONodesFeature();
551
    CDOFeature nameFeature = resourcePackage.getCDOResourceNodeClass().getCDONameFeature();
559
    CDOFeature nameFeature = resourcePackage.getCDOResourceNodeClass().getCDONameFeature();
552
560
553
    int size = folderRevision.getData().size(nodesFeature);
561
    int size = folderRevision.data().size(nodesFeature);
554
    for (int i = 0; i < size; i++)
562
    for (int i = 0; i < size; i++)
555
    {
563
    {
556
      Object value = folderRevision.getData().get(nodesFeature, i);
564
      Object value = folderRevision.data().get(nodesFeature, i);
557
      value = getStore().resolveProxy(folderRevision, nodesFeature, i, value);
565
      value = getStore().resolveProxy(folderRevision, nodesFeature, i, value);
558
566
559
      CDORevision childRevision = getLocalRevision((CDOID)value);
567
      CDORevision childRevision = getLocalRevision((CDOID)value);
560
      if (name.equals(childRevision.getData().get(nameFeature, 0)))
568
      if (name.equals(childRevision.data().get(nameFeature, 0)))
561
      {
569
      {
562
        return childRevision.getID();
570
        return childRevision.getID();
563
      }
571
      }
Lines 915-922 Link Here
915
    CDOResourceNodeClass resourceNodeClass = resourcePackage.getCDOResourceNodeClass();
923
    CDOResourceNodeClass resourceNodeClass = resourcePackage.getCDOResourceNodeClass();
916
    CDONameFeature nameFeature = resourceNodeClass.getCDONameFeature();
924
    CDONameFeature nameFeature = resourceNodeClass.getCDONameFeature();
917
925
918
    CDOID folderID = (CDOID)revision.getData().getContainerID();
926
    CDOID folderID = (CDOID)revision.data().getContainerID();
919
    String name = (String)revision.getData().get(nameFeature, 0);
927
    String name = (String)revision.data().get(nameFeature, 0);
920
    if (CDOIDUtil.isNull(folderID))
928
    if (CDOIDUtil.isNull(folderID))
921
    {
929
    {
922
      if (name == null)
930
      if (name == null)
Lines 1361-1366 Link Here
1361
  /**
1369
  /**
1362
   * @since 2.0
1370
   * @since 2.0
1363
   */
1371
   */
1372
  public ReferenceType getCacheReferenceType()
1373
  {
1374
    if (objects instanceof ReferenceValueMap.Strong)
1375
    {
1376
      return ReferenceType.STRONG;
1377
    }
1378
1379
    if (objects instanceof ReferenceValueMap.Soft)
1380
    {
1381
      return ReferenceType.SOFT;
1382
    }
1383
1384
    if (objects instanceof ReferenceValueMap.Weak)
1385
    {
1386
      return ReferenceType.WEAK;
1387
    }
1388
1389
    throw new IllegalStateException("referenceType");
1390
  }
1391
1392
  /**
1393
   * @since 2.0
1394
   */
1364
  public boolean setCacheReferenceType(ReferenceType referenceType)
1395
  public boolean setCacheReferenceType(ReferenceType referenceType)
1365
  {
1396
  {
1366
    if (referenceType == null)
1397
    if (referenceType == null)
(-)src/org/eclipse/emf/internal/cdo/CDOStore.java (-1 / +1 lines)
Lines 367-373 Link Here
367
        CDOID id = (CDOID)value;
367
        CDOID id = (CDOID)value;
368
        CDOList list = revision.getList(cdoFeature);
368
        CDOList list = revision.getList(cdoFeature);
369
        CDORevisionManagerImpl revisionManager = (CDORevisionManagerImpl)view.getSession().getRevisionManager();
369
        CDORevisionManagerImpl revisionManager = (CDORevisionManagerImpl)view.getSession().getRevisionManager();
370
        CDORevisionPrefetchingPolicy policy = view.getRevisionPrefetchingPolicy();
370
        CDORevisionPrefetchingPolicy policy = view.options().getRevisionPrefetchingPolicy();
371
        Collection<CDOID> listOfIDs = policy.loadAhead(revisionManager, eObject, eFeature, list, index, id);
371
        Collection<CDOID> listOfIDs = policy.loadAhead(revisionManager, eObject, eFeature, list, index, id);
372
        if (!listOfIDs.isEmpty())
372
        if (!listOfIDs.isEmpty())
373
        {
373
        {
(-)src/org/eclipse/emf/internal/cdo/CDOSessionConfigurationImpl.java (-1 / +1 lines)
Lines 179-185 Link Here
179
      return false;
179
      return false;
180
    }
180
    }
181
181
182
    if (session.isOpen())
182
    if (!session.isClosed())
183
    {
183
    {
184
      return true;
184
      return true;
185
    }
185
    }
(-)src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java (-14 / +31 lines)
Lines 20-25 Link Here
20
import org.eclipse.emf.cdo.CDOSessionInvalidationEvent;
20
import org.eclipse.emf.cdo.CDOSessionInvalidationEvent;
21
import org.eclipse.emf.cdo.CDOTimeStampContext;
21
import org.eclipse.emf.cdo.CDOTimeStampContext;
22
import org.eclipse.emf.cdo.CDOView;
22
import org.eclipse.emf.cdo.CDOView;
23
import org.eclipse.emf.cdo.CDOSession.Repository;
23
import org.eclipse.emf.cdo.common.CDOProtocolConstants;
24
import org.eclipse.emf.cdo.common.CDOProtocolConstants;
24
import org.eclipse.emf.cdo.common.CDOProtocolView;
25
import org.eclipse.emf.cdo.common.CDOProtocolView;
25
import org.eclipse.emf.cdo.common.id.CDOID;
26
import org.eclipse.emf.cdo.common.id.CDOID;
Lines 89-95 Link Here
89
/**
90
/**
90
 * @author Eike Stepper
91
 * @author Eike Stepper
91
 */
92
 */
92
public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSession
93
public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSession, Repository
93
{
94
{
94
  private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_SESSION, CDOSessionImpl.class);
95
  private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_SESSION, CDOSessionImpl.class);
95
96
Lines 172-177 Link Here
172
  /**
173
  /**
173
   * @since 2.0
174
   * @since 2.0
174
   */
175
   */
176
  public CDOSession.Options options()
177
  {
178
    return this;
179
  }
180
181
  /**
182
   * @since 2.0
183
   */
184
  public Repository repository()
185
  {
186
    return this;
187
  }
188
189
  /**
190
   * @since 2.0
191
   */
175
  public String getUserID()
192
  public String getUserID()
176
  {
193
  {
177
    IChannel channel = protocol.getChannel();
194
    IChannel channel = protocol.getChannel();
Lines 217-223 Link Here
217
    return protocol;
234
    return protocol;
218
  }
235
  }
219
236
220
  public String getRepositoryName()
237
  /**
238
   * @since 2.0
239
   */
240
  public String getName()
221
  {
241
  {
222
    return repositoryName;
242
    return repositoryName;
223
  }
243
  }
Lines 227-233 Link Here
227
    this.repositoryName = repositoryName;
247
    this.repositoryName = repositoryName;
228
  }
248
  }
229
249
230
  public String getRepositoryUUID()
250
  /**
251
   * @since 2.0
252
   */
253
  public String getUUID()
231
  {
254
  {
232
    return repositoryUUID;
255
    return repositoryUUID;
233
  }
256
  }
Lines 235-241 Link Here
235
  /**
258
  /**
236
   * @since 2.0
259
   * @since 2.0
237
   */
260
   */
238
  public long getRepositoryCreationTime()
261
  public long getCreationTime()
239
  {
262
  {
240
    checkActive();
263
    checkActive();
241
    return repositoryCreationTime;
264
    return repositoryCreationTime;
Lines 244-258 Link Here
244
  /**
267
  /**
245
   * @since 2.0
268
   * @since 2.0
246
   */
269
   */
247
  public long getRepositoryTime()
270
  public long getCurrentTime()
248
  {
271
  {
249
    return getRepositoryTime(false);
272
    return getCurrentTime(false);
250
  }
273
  }
251
274
252
  /**
275
  /**
253
   * @since 2.0
276
   * @since 2.0
254
   */
277
   */
255
  public long getRepositoryTime(boolean forceRefresh)
278
  public long getCurrentTime(boolean forceRefresh)
256
  {
279
  {
257
    checkActive();
280
    checkActive();
258
    if (repositoryTimeResult == null || forceRefresh)
281
    if (repositoryTimeResult == null || forceRefresh)
Lines 278-294 Link Here
278
  /**
301
  /**
279
   * @since 2.0
302
   * @since 2.0
280
   */
303
   */
281
  public boolean isRepositorySupportingAudits()
304
  public boolean isSupportingAudits()
282
  {
305
  {
283
    return repositorySupportingAudits;
306
    return repositorySupportingAudits;
284
  }
307
  }
285
308
286
  public boolean isOpen()
287
  {
288
    IChannel channel = protocol.getChannel();
289
    return channel != null;
290
  }
291
292
  public void close()
309
  public void close()
293
  {
310
  {
294
    deactivate();
311
    deactivate();
(-)src/org/eclipse/emf/internal/cdo/InternalCDOSession.java (-1 / +1 lines)
Lines 33-39 Link Here
33
 * @since 2.0
33
 * @since 2.0
34
 */
34
 */
35
public interface InternalCDOSession extends CDOSession, CDOIDObjectFactory, CDOPackageURICompressor,
35
public interface InternalCDOSession extends CDOSession, CDOIDObjectFactory, CDOPackageURICompressor,
36
    ILifecycle.Introspection
36
    ILifecycle.Introspection, CDOSession.Options
37
{
37
{
38
  public CDOSessionProtocol getProtocol();
38
  public CDOSessionProtocol getProtocol();
39
39
(-)src/org/eclipse/emf/internal/cdo/InternalCDOTransaction.java (-1 / +1 lines)
Lines 23-29 Link Here
23
 * @author Simon McDuff
23
 * @author Simon McDuff
24
 * @since 2.0
24
 * @since 2.0
25
 */
25
 */
26
public interface InternalCDOTransaction extends CDOTransaction, InternalCDOView
26
public interface InternalCDOTransaction extends CDOTransaction, InternalCDOView, CDOTransaction.Options
27
{
27
{
28
  public InternalCDOCommitContext createCommitContext();
28
  public InternalCDOCommitContext createCommitContext();
29
29
(-)src/org/eclipse/emf/internal/cdo/CDOViewSetImpl.java (-3 / +5 lines)
Lines 125-140 Link Here
125
125
126
  public void add(InternalCDOView view)
126
  public void add(InternalCDOView view)
127
  {
127
  {
128
    String repositoryUUID = view.getSession().repository().getUUID();
128
    synchronized (views)
129
    synchronized (views)
129
    {
130
    {
130
      CDOView lookupView = mapOfViews.get(view.getSession().getRepositoryUUID());
131
      CDOView lookupView = mapOfViews.get(repositoryUUID);
131
      if (lookupView != null)
132
      if (lookupView != null)
132
      {
133
      {
133
        throw new RuntimeException("Only one view/transaction per repository can be open for the same resource set");
134
        throw new RuntimeException("Only one view/transaction per repository can be open for the same resource set");
134
      }
135
      }
135
136
136
      views.add(view);
137
      views.add(view);
137
      mapOfViews.put(view.getSession().getRepositoryUUID(), view);
138
      mapOfViews.put(repositoryUUID, view);
138
139
139
      if (views.size() == 1)
140
      if (views.size() == 1)
140
      {
141
      {
Lines 151-162 Link Here
151
152
152
  public void remove(InternalCDOView view)
153
  public void remove(InternalCDOView view)
153
  {
154
  {
155
    String repositoryUUID = view.getSession().repository().getUUID();
154
    List<Resource> resToRemove = new ArrayList<Resource>();
156
    List<Resource> resToRemove = new ArrayList<Resource>();
155
    synchronized (views)
157
    synchronized (views)
156
    {
158
    {
157
      // It is important to remove view from the list first. It is the way we can differentiate close and detach.
159
      // It is important to remove view from the list first. It is the way we can differentiate close and detach.
158
      views.remove(view);
160
      views.remove(view);
159
      mapOfViews.remove(view.getSession().getRepositoryUUID());
161
      mapOfViews.remove(repositoryUUID);
160
162
161
      for (Resource resource : getResourceSet().getResources())
163
      for (Resource resource : getResourceSet().getResources())
162
      {
164
      {
(-)src/org/eclipse/emf/internal/cdo/InternalCDOView.java (-1 / +1 lines)
Lines 32-38 Link Here
32
 * @author Eike Stepper
32
 * @author Eike Stepper
33
 * @since 2.0
33
 * @since 2.0
34
 */
34
 */
35
public interface InternalCDOView extends CDOView, CDOIDProvider
35
public interface InternalCDOView extends CDOView, CDOIDProvider, CDOView.Options
36
{
36
{
37
  public InternalCDOSession getSession();
37
  public InternalCDOSession getSession();
38
38
(-)src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java (-13 / +10 lines)
Lines 14-19 Link Here
14
import org.eclipse.emf.cdo.CDOObject;
14
import org.eclipse.emf.cdo.CDOObject;
15
import org.eclipse.emf.cdo.CDOSavepoint;
15
import org.eclipse.emf.cdo.CDOSavepoint;
16
import org.eclipse.emf.cdo.CDOState;
16
import org.eclipse.emf.cdo.CDOState;
17
import org.eclipse.emf.cdo.CDOTransaction;
17
import org.eclipse.emf.cdo.CDOTransactionConflictEvent;
18
import org.eclipse.emf.cdo.CDOTransactionConflictEvent;
18
import org.eclipse.emf.cdo.CDOTransactionFinishedEvent;
19
import org.eclipse.emf.cdo.CDOTransactionFinishedEvent;
19
import org.eclipse.emf.cdo.CDOTransactionHandler;
20
import org.eclipse.emf.cdo.CDOTransactionHandler;
Lines 89-96 Link Here
89
90
90
  private boolean conflict;
91
  private boolean conflict;
91
92
92
  private long commitTimeout;
93
94
  private long lastCommitTime = CDORevision.UNSPECIFIED_DATE;
93
  private long lastCommitTime = CDORevision.UNSPECIFIED_DATE;
95
94
96
  private int lastTemporaryID;
95
  private int lastTemporaryID;
Lines 105-111 Link Here
105
  public CDOTransactionImpl(InternalCDOSession session, int id)
104
  public CDOTransactionImpl(InternalCDOSession session, int id)
106
  {
105
  {
107
    super(session, id);
106
    super(session, id);
108
    commitTimeout = OM.PREF_DEFAULT_COMMIT_TIMEOUT.getValue();
109
  }
107
  }
110
108
111
  @Override
109
  @Override
Lines 114-119 Link Here
114
    return Type.TRANSACTION;
112
    return Type.TRANSACTION;
115
  }
113
  }
116
114
115
  /**
116
   * @since 2.0
117
   */
118
  @Override
119
  public CDOTransaction.Options options()
120
  {
121
    return this;
122
  }
123
117
  public void addHandler(CDOTransactionHandler handler)
124
  public void addHandler(CDOTransactionHandler handler)
118
  {
125
  {
119
    synchronized (handlers)
126
    synchronized (handlers)
Lines 162-177 Link Here
162
    fireEvent(event);
169
    fireEvent(event);
163
  }
170
  }
164
171
165
  public long getCommitTimeout()
166
  {
167
    return commitTimeout;
168
  }
169
170
  public void setCommitTimeout(long timeout)
171
  {
172
    commitTimeout = timeout;
173
  }
174
175
  /**
172
  /**
176
   * @since 2.0
173
   * @since 2.0
177
   */
174
   */
(-)src/org/eclipse/emf/cdo/util/CDOURIUtil.java (-4 / +4 lines)
Lines 126-139 Link Here
126
    return URI.createURI(stringBuilder.toString());
126
    return URI.createURI(stringBuilder.toString());
127
  }
127
  }
128
128
129
  public static URI createResourceURI(CDOView cdoView, String path)
129
  public static URI createResourceURI(CDOView view, String path)
130
  {
130
  {
131
    return createResourceURI(cdoView == null ? null : cdoView.getSession(), path);
131
    return createResourceURI(view == null ? null : view.getSession(), path);
132
  }
132
  }
133
133
134
  public static URI createResourceURI(CDOSession cdoSession, String path)
134
  public static URI createResourceURI(CDOSession session, String path)
135
  {
135
  {
136
    return createResourceURI(cdoSession == null ? null : cdoSession.getRepositoryUUID(), path);
136
    return createResourceURI(session == null ? null : session.repository().getUUID(), path);
137
  }
137
  }
138
138
139
  /**
139
  /**
(-)src/org/eclipse/emf/internal/cdo/bundle/OM.java (-5 / +1 lines)
Lines 10-16 Link Here
10
 **************************************************************************/
10
 **************************************************************************/
11
package org.eclipse.emf.internal.cdo.bundle;
11
package org.eclipse.emf.internal.cdo.bundle;
12
12
13
import org.eclipse.emf.cdo.CDOTransaction;
14
import org.eclipse.emf.cdo.CDOView;
13
import org.eclipse.emf.cdo.CDOView;
15
import org.eclipse.emf.cdo.common.revision.CDORevision;
14
import org.eclipse.emf.cdo.common.revision.CDORevision;
16
15
Lines 84-91 Link Here
84
  PREFS.init("PREF_ENABLE_INVALIDATION_NOTIFICATION", false); //$NON-NLS-1$
83
  PREFS.init("PREF_ENABLE_INVALIDATION_NOTIFICATION", false); //$NON-NLS-1$
85
84
86
  public static final OMPreference<Integer> PREF_REVISION_LOADING_CHUNK_SIZE = //
85
  public static final OMPreference<Integer> PREF_REVISION_LOADING_CHUNK_SIZE = //
87
  PREFS.init("PREF_REVISION_LOADING_CHUNK_SIZE", CDOView.NO_REVISION_PREFETCHING); //$NON-NLS-1$
86
  PREFS.init("PREF_REVISION_LOADING_CHUNK_SIZE", CDOView.Options.NO_REVISION_PREFETCHING); //$NON-NLS-1$
88
89
  public static final OMPreference<Long> PREF_DEFAULT_COMMIT_TIMEOUT = //
90
  PREFS.init("PREF_DEFAULT_COMMIT_TIMEOUT", CDOTransaction.DEFAULT_COMMIT_TIMEOUT); //$NON-NLS-1$
91
}
87
}
(-)src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java (-1 / +1 lines)
Lines 67-73 Link Here
67
      TRACER.format("preTraverseFeature : {0}.{1}", cdoObject.cdoClass(), feature.getName());
67
      TRACER.format("preTraverseFeature : {0}.{1}", cdoObject.cdoClass(), feature.getName());
68
    }
68
    }
69
69
70
    loadCollectionPolicy = cdoObject.cdoView().getSession().getCollectionLoadingPolicy();
70
    loadCollectionPolicy = cdoObject.cdoView().getSession().options().getCollectionLoadingPolicy();
71
    lastTraverseFeature = feature;
71
    lastTraverseFeature = feature;
72
    lastTraverseCDOObject = cdoObject;
72
    lastTraverseCDOObject = cdoObject;
73
    lastTraverseIndex = index;
73
    lastTraverseIndex = index;
(-)src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java (-1 / +1 lines)
Lines 203-209 Link Here
203
    Collection<CDORevisionDelta> revisionDeltas = commitContext.getRevisionDeltas().values();
203
    Collection<CDORevisionDelta> revisionDeltas = commitContext.getRevisionDeltas().values();
204
    Collection<CDOID> detachedObjects = commitContext.getDetachedObjects().keySet();
204
    Collection<CDOID> detachedObjects = commitContext.getDetachedObjects().keySet();
205
205
206
    out.writeBoolean(commitContext.getTransaction().isAutoReleaseLocksEnabled());
206
    out.writeBoolean(commitContext.getTransaction().options().isAutoReleaseLocksEnabled());
207
    out.writeInt(newPackages.size());
207
    out.writeInt(newPackages.size());
208
    out.writeInt(newResources.size() + newObjects.size());
208
    out.writeInt(newResources.size() + newObjects.size());
209
    out.writeInt(revisionDeltas.size());
209
    out.writeInt(revisionDeltas.size());
(-)src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250036_Test.java (-1 / +1 lines)
Lines 75-81 Link Here
75
    }
75
    }
76
    final TestAdapter counter = new TestAdapter();
76
    final TestAdapter counter = new TestAdapter();
77
    genRefMap.eAdapters().add(counter);
77
    genRefMap.eAdapters().add(counter);
78
    transaction2.setInvalidationNotificationEnabled(true);
78
    transaction2.options().setInvalidationNotificationEnabled(true);
79
79
80
    /********* transaction 1 ***************/
80
    /********* transaction 1 ***************/
81
    for (int i = 10; i < 20; i++)
81
    for (int i = 10; i < 20; i++)
(-)src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_251087_Test.java (-6 / +6 lines)
Lines 44-51 Link Here
44
    CDOSession session = openModel1Session();
44
    CDOSession session = openModel1Session();
45
    CDOTransaction transaction1 = session.openTransaction();
45
    CDOTransaction transaction1 = session.openTransaction();
46
46
47
    transaction1.setInvalidationNotificationEnabled(true);
47
    transaction1.options().setInvalidationNotificationEnabled(true);
48
    transaction1.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
48
    transaction1.options().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
49
49
50
    String resourcePath = "/test1";
50
    String resourcePath = "/test1";
51
    CDOResource res = transaction1.createResource(resourcePath);
51
    CDOResource res = transaction1.createResource(resourcePath);
Lines 70-77 Link Here
70
    CDOSession sessionB = openModel1Session();
70
    CDOSession sessionB = openModel1Session();
71
    CDOTransaction transaction1 = sessionA.openTransaction();
71
    CDOTransaction transaction1 = sessionA.openTransaction();
72
72
73
    transaction1.setInvalidationNotificationEnabled(true);
73
    transaction1.options().setInvalidationNotificationEnabled(true);
74
    transaction1.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
74
    transaction1.options().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
75
75
76
    String resourcePath = "/test1";
76
    String resourcePath = "/test1";
77
    CDOResource res = transaction1.createResource(resourcePath);
77
    CDOResource res = transaction1.createResource(resourcePath);
Lines 82-89 Link Here
82
    CDOTransaction transB1 = sessionB.openTransaction();
82
    CDOTransaction transB1 = sessionB.openTransaction();
83
    CDOID companyID = CDOUtil.getCDOObject(obj2).cdoID();
83
    CDOID companyID = CDOUtil.getCDOObject(obj2).cdoID();
84
    Company companyB = (Company)transB1.getObject(companyID);
84
    Company companyB = (Company)transB1.getObject(companyID);
85
    sessionB.setPassiveUpdateEnabled(false);
85
    sessionB.options().setPassiveUpdateEnabled(false);
86
    transB1.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
86
    transB1.options().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
87
    final TestAdapter testAdapter = new TestAdapter();
87
    final TestAdapter testAdapter = new TestAdapter();
88
    companyB.eAdapters().add(testAdapter);
88
    companyB.eAdapters().add(testAdapter);
89
    assertEquals(true, ((InternalCDOTransaction)transB1).hasSubscription(companyID));
89
    assertEquals(true, ((InternalCDOTransaction)transB1).hasSubscription(companyID));
(-)src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250910_Test.java (-1 / +1 lines)
Lines 60-66 Link Here
60
60
61
      transaction1.commit();
61
      transaction1.commit();
62
62
63
      transaction2.setInvalidationNotificationEnabled(true);
63
      transaction2.options().setInvalidationNotificationEnabled(true);
64
      Company company2 = (Company)transaction2.getObject(id, true);
64
      Company company2 = (Company)transaction2.getObject(id, true);
65
      company2.eAdapters().add(testAdapter);
65
      company2.eAdapters().add(testAdapter);
66
66
(-)src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_254489_Test.java (-2 / +2 lines)
Lines 42-48 Link Here
42
    msg("Opening session");
42
    msg("Opening session");
43
    final CDOSession session = openModel1Session();
43
    final CDOSession session = openModel1Session();
44
44
45
    session.setPassiveUpdateEnabled(false);
45
    session.options().setPassiveUpdateEnabled(false);
46
46
47
    // ************************************************************* //
47
    // ************************************************************* //
48
    msg("Opening transaction");
48
    msg("Opening transaction");
Lines 55-61 Link Here
55
55
56
    transaction1.commit();
56
    transaction1.commit();
57
57
58
    transaction2.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
58
    transaction2.options().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
59
    CDOResource res2 = transaction2.getResource("/res1");
59
    CDOResource res2 = transaction2.getResource("/res1");
60
    Company companyA2 = (Company)res2.getContents().get(0);
60
    Company companyA2 = (Company)res2.getContents().get(0);
61
    final TestAdapter companyA2Adapter = new TestAdapter();
61
    final TestAdapter companyA2Adapter = new TestAdapter();
(-)src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246622_Test.java (-20 / +20 lines)
Lines 43-51 Link Here
43
    order.getOrderDetails().add(orderDetail);
43
    order.getOrderDetails().add(orderDetail);
44
    CDOFeature order_OrderDetailFeature = session.getPackageManager().convert(
44
    CDOFeature order_OrderDetailFeature = session.getPackageManager().convert(
45
        getModel1Package().getOrder_OrderDetails());
45
        getModel1Package().getOrder_OrderDetails());
46
    assertEquals(orderDetail, CDOUtil.getCDOObject(order).cdoRevision().getData().get(order_OrderDetailFeature, 0));
46
    assertEquals(orderDetail, CDOUtil.getCDOObject(order).cdoRevision().data().get(order_OrderDetailFeature, 0));
47
47
48
    assertEquals(order, CDOUtil.getCDOObject(orderDetail).cdoRevision().getData().getContainerID());
48
    assertEquals(order, CDOUtil.getCDOObject(orderDetail).cdoRevision().data().getContainerID());
49
49
50
    Order order2 = getModel1Factory().createOrder();
50
    Order order2 = getModel1Factory().createOrder();
51
    OrderDetail orderDetail2 = getModel1Factory().createOrderDetail();
51
    OrderDetail orderDetail2 = getModel1Factory().createOrderDetail();
Lines 53-72 Link Here
53
    order2.getOrderDetails().add(orderDetail2);
53
    order2.getOrderDetails().add(orderDetail2);
54
    res.getContents().add(order2);
54
    res.getContents().add(order2);
55
55
56
    assertEquals(orderDetail2, CDOUtil.getCDOObject(order2).cdoRevision().getData().get(order_OrderDetailFeature, 0));
56
    assertEquals(orderDetail2, CDOUtil.getCDOObject(order2).cdoRevision().data().get(order_OrderDetailFeature, 0));
57
    assertEquals(order2, CDOUtil.getCDOObject(orderDetail2).cdoRevision().getData().getContainerID());
57
    assertEquals(order2, CDOUtil.getCDOObject(orderDetail2).cdoRevision().data().getContainerID());
58
58
59
    msg("Committing");
59
    msg("Committing");
60
    transaction1.commit();
60
    transaction1.commit();
61
61
62
    assertEquals(CDOUtil.getCDOObject(orderDetail).cdoID(), CDOUtil.getCDOObject(order).cdoRevision().getData().get(
62
    assertEquals(CDOUtil.getCDOObject(orderDetail).cdoID(), CDOUtil.getCDOObject(order).cdoRevision().data().get(
63
        order_OrderDetailFeature, 0));
63
        order_OrderDetailFeature, 0));
64
    assertEquals(CDOUtil.getCDOObject(orderDetail2).cdoID(), CDOUtil.getCDOObject(order2).cdoRevision().getData().get(
64
    assertEquals(CDOUtil.getCDOObject(orderDetail2).cdoID(), CDOUtil.getCDOObject(order2).cdoRevision().data().get(
65
        order_OrderDetailFeature, 0));
65
        order_OrderDetailFeature, 0));
66
66
67
    assertEquals(CDOUtil.getCDOObject(order).cdoID(), CDOUtil.getCDOObject(orderDetail).cdoRevision().getData()
67
    assertEquals(CDOUtil.getCDOObject(order).cdoID(), CDOUtil.getCDOObject(orderDetail).cdoRevision().data()
68
        .getContainerID());
68
        .getContainerID());
69
    assertEquals(CDOUtil.getCDOObject(order2).cdoID(), CDOUtil.getCDOObject(orderDetail2).cdoRevision().getData()
69
    assertEquals(CDOUtil.getCDOObject(order2).cdoID(), CDOUtil.getCDOObject(orderDetail2).cdoRevision().data()
70
        .getContainerID());
70
        .getContainerID());
71
71
72
    Order order3 = getModel1Factory().createOrder();
72
    Order order3 = getModel1Factory().createOrder();
Lines 74-82 Link Here
74
    res.getContents().add(order3);
74
    res.getContents().add(order3);
75
    order3.getOrderDetails().add(orderDetail2);
75
    order3.getOrderDetails().add(orderDetail2);
76
76
77
    assertEquals(CDOUtil.getCDOObject(orderDetail2).cdoID(), CDOUtil.getCDOObject(order3).cdoRevision().getData().get(
77
    assertEquals(CDOUtil.getCDOObject(orderDetail2).cdoID(), CDOUtil.getCDOObject(order3).cdoRevision().data().get(
78
        order_OrderDetailFeature, 0));
78
        order_OrderDetailFeature, 0));
79
    assertEquals(CDOUtil.getCDOObject(order3), CDOUtil.getCDOObject(orderDetail2).cdoRevision().getData()
79
    assertEquals(CDOUtil.getCDOObject(order3), CDOUtil.getCDOObject(orderDetail2).cdoRevision().data()
80
        .getContainerID());
80
        .getContainerID());
81
81
82
    msg("Committing");
82
    msg("Committing");
Lines 104-111 Link Here
104
    CDOFeature purchaseOrder_Supplier = session.getPackageManager().convert(
104
    CDOFeature purchaseOrder_Supplier = session.getPackageManager().convert(
105
        getModel1Package().getPurchaseOrder_Supplier());
105
        getModel1Package().getPurchaseOrder_Supplier());
106
106
107
    assertEquals(supplier, CDOUtil.getCDOObject(purchaseOrder).cdoRevision().getData().get(purchaseOrder_Supplier, 0));
107
    assertEquals(supplier, CDOUtil.getCDOObject(purchaseOrder).cdoRevision().data().get(purchaseOrder_Supplier, 0));
108
    assertEquals(purchaseOrder, CDOUtil.getCDOObject(supplier).cdoRevision().getData().get(supplier_PurchaseOrder, 0));
108
    assertEquals(purchaseOrder, CDOUtil.getCDOObject(supplier).cdoRevision().data().get(supplier_PurchaseOrder, 0));
109
109
110
    msg("Test set with link after");
110
    msg("Test set with link after");
111
    PurchaseOrder purchaseOrder2 = getModel1Factory().createPurchaseOrder();
111
    PurchaseOrder purchaseOrder2 = getModel1Factory().createPurchaseOrder();
Lines 115-134 Link Here
115
    res.getContents().add(supplier2);
115
    res.getContents().add(supplier2);
116
    purchaseOrder2.setSupplier(supplier2);
116
    purchaseOrder2.setSupplier(supplier2);
117
117
118
    assertEquals(supplier2, CDOUtil.getCDOObject(purchaseOrder2).cdoRevision().getData().get(purchaseOrder_Supplier, 0));
118
    assertEquals(supplier2, CDOUtil.getCDOObject(purchaseOrder2).cdoRevision().data().get(purchaseOrder_Supplier, 0));
119
    assertEquals(purchaseOrder2, CDOUtil.getCDOObject(supplier2).cdoRevision().getData().get(supplier_PurchaseOrder, 0));
119
    assertEquals(purchaseOrder2, CDOUtil.getCDOObject(supplier2).cdoRevision().data().get(supplier_PurchaseOrder, 0));
120
120
121
    msg("Committing");
121
    msg("Committing");
122
    transaction1.commit();
122
    transaction1.commit();
123
123
124
    assertEquals(CDOUtil.getCDOObject(supplier2).cdoID(), CDOUtil.getCDOObject(purchaseOrder2).cdoRevision().getData()
124
    assertEquals(CDOUtil.getCDOObject(supplier2).cdoID(), CDOUtil.getCDOObject(purchaseOrder2).cdoRevision().data()
125
        .get(purchaseOrder_Supplier, 0));
125
        .get(purchaseOrder_Supplier, 0));
126
    assertEquals(CDOUtil.getCDOObject(purchaseOrder2).cdoID(), CDOUtil.getCDOObject(supplier2).cdoRevision().getData()
126
    assertEquals(CDOUtil.getCDOObject(purchaseOrder2).cdoID(), CDOUtil.getCDOObject(supplier2).cdoRevision().data()
127
        .get(supplier_PurchaseOrder, 0));
127
        .get(supplier_PurchaseOrder, 0));
128
128
129
    assertEquals(CDOUtil.getCDOObject(supplier).cdoID(), CDOUtil.getCDOObject(purchaseOrder).cdoRevision().getData()
129
    assertEquals(CDOUtil.getCDOObject(supplier).cdoID(), CDOUtil.getCDOObject(purchaseOrder).cdoRevision().data()
130
        .get(purchaseOrder_Supplier, 0));
130
        .get(purchaseOrder_Supplier, 0));
131
    assertEquals(CDOUtil.getCDOObject(purchaseOrder).cdoID(), CDOUtil.getCDOObject(supplier).cdoRevision().getData()
131
    assertEquals(CDOUtil.getCDOObject(purchaseOrder).cdoID(), CDOUtil.getCDOObject(supplier).cdoRevision().data()
132
        .get(supplier_PurchaseOrder, 0));
132
        .get(supplier_PurchaseOrder, 0));
133
133
134
    msg("Test set with persisted CDOID");
134
    msg("Test set with persisted CDOID");
Lines 136-144 Link Here
136
    purchaseOrder3.setSupplier(supplier2);
136
    purchaseOrder3.setSupplier(supplier2);
137
    res.getContents().add(purchaseOrder3);
137
    res.getContents().add(purchaseOrder3);
138
138
139
    assertEquals(CDOUtil.getCDOObject(supplier2).cdoID(), CDOUtil.getCDOObject(purchaseOrder3).cdoRevision().getData()
139
    assertEquals(CDOUtil.getCDOObject(supplier2).cdoID(), CDOUtil.getCDOObject(purchaseOrder3).cdoRevision().data()
140
        .get(purchaseOrder_Supplier, 0));
140
        .get(purchaseOrder_Supplier, 0));
141
    assertEquals(purchaseOrder3, CDOUtil.getCDOObject(supplier2).cdoRevision().getData().get(supplier_PurchaseOrder, 1));
141
    assertEquals(purchaseOrder3, CDOUtil.getCDOObject(supplier2).cdoRevision().data().get(supplier_PurchaseOrder, 1));
142
142
143
    msg("Committing");
143
    msg("Committing");
144
    transaction1.commit();
144
    transaction1.commit();
(-)src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_252214_Test.java (-2 / +2 lines)
Lines 59-72 Link Here
59
      resource.getContents().add(company);
59
      resource.getContents().add(company);
60
      transaction.commit();
60
      transaction.commit();
61
      commitTime1 = transaction.getLastCommitTime();
61
      commitTime1 = transaction.getLastCommitTime();
62
      assertTrue(session.getRepositoryCreationTime() < commitTime1);
62
      assertTrue(session.repository().getCreationTime() < commitTime1);
63
      assertEquals("ESC", company.getName());
63
      assertEquals("ESC", company.getName());
64
64
65
      company.setName("Sympedia");
65
      company.setName("Sympedia");
66
      transaction.commit();
66
      transaction.commit();
67
      commitTime2 = transaction.getLastCommitTime();
67
      commitTime2 = transaction.getLastCommitTime();
68
      assertTrue(commitTime1 < commitTime2);
68
      assertTrue(commitTime1 < commitTime2);
69
      assertTrue(session.getRepositoryCreationTime() < commitTime2);
69
      assertTrue(session.repository().getCreationTime() < commitTime2);
70
      assertEquals("Sympedia", company.getName());
70
      assertEquals("Sympedia", company.getName());
71
    }
71
    }
72
    CDOSession session = openModel1Session();
72
    CDOSession session = openModel1Session();
(-)src/org/eclipse/emf/cdo/tests/AdapterManagerTest.java (-15 / +15 lines)
Lines 37-43 Link Here
37
    msg("Opening session");
37
    msg("Opening session");
38
    final CDOSession session = openModel1Session();
38
    final CDOSession session = openModel1Session();
39
39
40
    session.setPassiveUpdateEnabled(false);
40
    session.options().setPassiveUpdateEnabled(false);
41
41
42
    // ************************************************************* //
42
    // ************************************************************* //
43
43
Lines 46-52 Link Here
46
    TestAdapter testAdapter = new TestAdapter();
46
    TestAdapter testAdapter = new TestAdapter();
47
    msg("Opening transaction");
47
    msg("Opening transaction");
48
    CDOTransaction transaction = session.openTransaction();
48
    CDOTransaction transaction = session.openTransaction();
49
    transaction.setCacheReferenceType(ReferenceType.WEAK);
49
    transaction.options().setCacheReferenceType(ReferenceType.WEAK);
50
50
51
    transaction.createResource("/resA").getContents().add(companyA);
51
    transaction.createResource("/resA").getContents().add(companyA);
52
52
Lines 71-77 Link Here
71
    msg("Opening session");
71
    msg("Opening session");
72
    final CDOSession session = openModel1Session();
72
    final CDOSession session = openModel1Session();
73
73
74
    session.setPassiveUpdateEnabled(false);
74
    session.options().setPassiveUpdateEnabled(false);
75
75
76
    // ************************************************************* //
76
    // ************************************************************* //
77
77
Lines 80-87 Link Here
80
    TestAdapter testAdapter = new TestAdapter();
80
    TestAdapter testAdapter = new TestAdapter();
81
    msg("Opening transaction");
81
    msg("Opening transaction");
82
    CDOTransaction transaction = session.openTransaction();
82
    CDOTransaction transaction = session.openTransaction();
83
    transaction.setCacheReferenceType(ReferenceType.WEAK);
83
    transaction.options().setCacheReferenceType(ReferenceType.WEAK);
84
    transaction.setStrongReferencePolicy(CDOAdapterPolicy.ALL);
84
    transaction.options().setStrongReferencePolicy(CDOAdapterPolicy.ALL);
85
85
86
    transaction.createResource("/resA").getContents().add(companyA);
86
    transaction.createResource("/resA").getContents().add(companyA);
87
87
Lines 107-113 Link Here
107
    msg("Opening session");
107
    msg("Opening session");
108
    final CDOSession session = openModel1Session();
108
    final CDOSession session = openModel1Session();
109
109
110
    session.setPassiveUpdateEnabled(false);
110
    session.options().setPassiveUpdateEnabled(false);
111
111
112
    // ************************************************************* //
112
    // ************************************************************* //
113
113
Lines 119-126 Link Here
119
119
120
    msg("Opening transaction");
120
    msg("Opening transaction");
121
    CDOTransaction transaction = session.openTransaction();
121
    CDOTransaction transaction = session.openTransaction();
122
    transaction.setCacheReferenceType(ReferenceType.WEAK);
122
    transaction.options().setCacheReferenceType(ReferenceType.WEAK);
123
    transaction.setStrongReferencePolicy(CDOAdapterPolicy.ALL);
123
    transaction.options().setStrongReferencePolicy(CDOAdapterPolicy.ALL);
124
124
125
    transaction.createResource("/resA").getContents().add(companyA);
125
    transaction.createResource("/resA").getContents().add(companyA);
126
126
Lines 146-152 Link Here
146
    msg("Opening session");
146
    msg("Opening session");
147
    final CDOSession session = openModel1Session();
147
    final CDOSession session = openModel1Session();
148
148
149
    session.setPassiveUpdateEnabled(false);
149
    session.options().setPassiveUpdateEnabled(false);
150
150
151
    // ************************************************************* //
151
    // ************************************************************* //
152
152
Lines 160-167 Link Here
160
160
161
    msg("Opening transaction");
161
    msg("Opening transaction");
162
    CDOTransaction transaction = session.openTransaction();
162
    CDOTransaction transaction = session.openTransaction();
163
    transaction.setCacheReferenceType(ReferenceType.WEAK);
163
    transaction.options().setCacheReferenceType(ReferenceType.WEAK);
164
    transaction.setStrongReferencePolicy(CDOAdapterPolicy.ALL);
164
    transaction.options().setStrongReferencePolicy(CDOAdapterPolicy.ALL);
165
165
166
    transaction.createResource("/resA").getContents().add(companyA);
166
    transaction.createResource("/resA").getContents().add(companyA);
167
167
Lines 192-198 Link Here
192
    msg("Opening session");
192
    msg("Opening session");
193
    final CDOSession session = openModel1Session();
193
    final CDOSession session = openModel1Session();
194
194
195
    session.setPassiveUpdateEnabled(false);
195
    session.options().setPassiveUpdateEnabled(false);
196
196
197
    // ************************************************************* //
197
    // ************************************************************* //
198
198
Lines 204-223 Link Here
204
204
205
    msg("Opening transaction");
205
    msg("Opening transaction");
206
    CDOTransaction transaction = session.openTransaction();
206
    CDOTransaction transaction = session.openTransaction();
207
    transaction.setCacheReferenceType(ReferenceType.WEAK);
207
    transaction.options().setCacheReferenceType(ReferenceType.WEAK);
208
    transaction.createResource("/resA").getContents().add(companyA);
208
    transaction.createResource("/resA").getContents().add(companyA);
209
209
210
    msg("Committing");
210
    msg("Committing");
211
    transaction.commit();
211
    transaction.commit();
212
    CDOID id = CDOUtil.getCDOObject(companyA).cdoID();
212
    CDOID id = CDOUtil.getCDOObject(companyA).cdoID();
213
    transaction.setStrongReferencePolicy(CDOAdapterPolicy.ALL);
213
    transaction.options().setStrongReferencePolicy(CDOAdapterPolicy.ALL);
214
    companyA = null;
214
    companyA = null;
215
215
216
    testAdapter.getNotifications().clear();
216
    testAdapter.getNotifications().clear();
217
    System.gc();
217
    System.gc();
218
218
219
    assertEquals(true, transaction.isObjectRegistered(id));
219
    assertEquals(true, transaction.isObjectRegistered(id));
220
    transaction.setStrongReferencePolicy(CDOAdapterPolicy.NONE);
220
    transaction.options().setStrongReferencePolicy(CDOAdapterPolicy.NONE);
221
221
222
    System.gc();
222
    System.gc();
223
223
(-)src/org/eclipse/emf/cdo/tests/ChunkingTest.java (-5 / +5 lines)
Lines 56-62 Link Here
56
    // ************************************************************* //
56
    // ************************************************************* //
57
57
58
    CDOSession session = openModel1Session();
58
    CDOSession session = openModel1Session();
59
    session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
59
    session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
60
60
61
    CDOTransaction transaction = session.openTransaction();
61
    CDOTransaction transaction = session.openTransaction();
62
    CDOResource resource = transaction.getResource("/test1");
62
    CDOResource resource = transaction.getResource("/test1");
Lines 101-107 Link Here
101
    // ************************************************************* //
101
    // ************************************************************* //
102
102
103
    CDOSession session = openModel1Session();
103
    CDOSession session = openModel1Session();
104
    session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
104
    session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
105
105
106
    CDOTransaction transaction = session.openTransaction();
106
    CDOTransaction transaction = session.openTransaction();
107
    CDOResource resource = transaction.getResource("/test1");
107
    CDOResource resource = transaction.getResource("/test1");
Lines 142-148 Link Here
142
    CDOSession session = openModel1Session();
142
    CDOSession session = openModel1Session();
143
143
144
    CDOTransaction transaction = session.openTransaction();
144
    CDOTransaction transaction = session.openTransaction();
145
    transaction.setRevisionPrefetchingPolicy(CDOUtil.createRevisionPrefetchingPolicy(10));
145
    transaction.options().setRevisionPrefetchingPolicy(CDOUtil.createRevisionPrefetchingPolicy(10));
146
146
147
    CDOResource resource = transaction.getResource("/test1");
147
    CDOResource resource = transaction.getResource("/test1");
148
148
Lines 179-185 Link Here
179
    // ************************************************************* //
179
    // ************************************************************* //
180
180
181
    CDOSession session = openModel1Session();
181
    CDOSession session = openModel1Session();
182
    session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
182
    session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
183
183
184
    CDOTransaction transaction = session.openTransaction();
184
    CDOTransaction transaction = session.openTransaction();
185
    CDOResource resource = transaction.getResource("/test1");
185
    CDOResource resource = transaction.getResource("/test1");
Lines 221-227 Link Here
221
    // ************************************************************* //
221
    // ************************************************************* //
222
222
223
    CDOSession session = openModel1Session();
223
    CDOSession session = openModel1Session();
224
    session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
224
    session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
225
225
226
    msg("Creating resource");
226
    msg("Creating resource");
227
    CDOTransaction transaction = session.openTransaction();
227
    CDOTransaction transaction = session.openTransaction();
(-)src/org/eclipse/emf/cdo/tests/MultiValuedOfAttributeTest.java (-1 / +1 lines)
Lines 200-206 Link Here
200
200
201
    {
201
    {
202
      CDOSession session = openSession(getModel5Package());
202
      CDOSession session = openSession(getModel5Package());
203
      session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(0, 100));
203
      session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(0, 100));
204
      CDOTransaction transaction = session.openTransaction();
204
      CDOTransaction transaction = session.openTransaction();
205
      CDOResource resource = transaction.getResource("/res1");
205
      CDOResource resource = transaction.getResource("/res1");
206
206
(-)src/org/eclipse/emf/cdo/tests/RepositoryTest.java (-2 / +2 lines)
Lines 75-81 Link Here
75
        {
75
        {
76
          if (revision.getCDOClass() == customerClass)
76
          if (revision.getCDOClass() == customerClass)
77
          {
77
          {
78
            String name = (String)revision.getData().get(nameFeature, 0);
78
            String name = (String)revision.data().get(nameFeature, 0);
79
            if ("Admin".equals(name))
79
            if ("Admin".equals(name))
80
            {
80
            {
81
              throw new IllegalStateException("Adding a customer with name 'Admin' is not allowed");
81
              throw new IllegalStateException("Adding a customer with name 'Admin' is not allowed");
Lines 135-141 Link Here
135
      {
135
      {
136
        if (revision.getCDOClass() == customerClass)
136
        if (revision.getCDOClass() == customerClass)
137
        {
137
        {
138
          String name = (String)revision.getData().get(nameFeature, 0);
138
          String name = (String)revision.data().get(nameFeature, 0);
139
          if ("Admin".equals(name))
139
          if ("Admin".equals(name))
140
          {
140
          {
141
            return "Confidential!";
141
            return "Confidential!";
(-)src/org/eclipse/emf/cdo/tests/InvalidationTest.java (-7 / +7 lines)
Lines 589-595 Link Here
589
    msg("Opening sessionB");
589
    msg("Opening sessionB");
590
    final CDOSession sessionB = openModel1Session();
590
    final CDOSession sessionB = openModel1Session();
591
591
592
    sessionB.setPassiveUpdateEnabled(false);
592
    sessionB.options().setPassiveUpdateEnabled(false);
593
593
594
    msg("Attaching viewB");
594
    msg("Attaching viewB");
595
    final CDOView viewB = sessionB.openTransaction();
595
    final CDOView viewB = sessionB.openTransaction();
Lines 668-674 Link Here
668
    msg("Opening sessionB");
668
    msg("Opening sessionB");
669
    final CDOSession sessionB = openModel1Session();
669
    final CDOSession sessionB = openModel1Session();
670
670
671
    sessionB.setPassiveUpdateEnabled(false);
671
    sessionB.options().setPassiveUpdateEnabled(false);
672
672
673
    msg("Attaching viewB");
673
    msg("Attaching viewB");
674
    final CDOView viewB = sessionB.openTransaction();
674
    final CDOView viewB = sessionB.openTransaction();
Lines 679-685 Link Here
679
    msg("Opening sessionB");
679
    msg("Opening sessionB");
680
    final CDOSession sessionC = openModel1Session();
680
    final CDOSession sessionC = openModel1Session();
681
681
682
    assertEquals(true, sessionC.isPassiveUpdateEnabled());
682
    assertEquals(true, sessionC.options().isPassiveUpdateEnabled());
683
683
684
    msg("Attaching viewB");
684
    msg("Attaching viewB");
685
    final CDOView viewC = sessionC.openTransaction();
685
    final CDOView viewC = sessionC.openTransaction();
Lines 719-725 Link Here
719
    assertEquals(false, timeOuterC.timedOut());
719
    assertEquals(false, timeOuterC.timedOut());
720
720
721
    // It should refresh the session
721
    // It should refresh the session
722
    sessionB.setPassiveUpdateEnabled(true);
722
    sessionB.options().setPassiveUpdateEnabled(true);
723
723
724
    msg("Checking after sync");
724
    msg("Checking after sync");
725
    assertEquals(false, timeOuterB.timedOut());
725
    assertEquals(false, timeOuterB.timedOut());
Lines 784-790 Link Here
784
784
785
    msg("Attaching viewB");
785
    msg("Attaching viewB");
786
    final CDOView viewB = sessionB.openTransaction();
786
    final CDOView viewB = sessionB.openTransaction();
787
    viewB.setInvalidationNotificationEnabled(true);
787
    viewB.options().setInvalidationNotificationEnabled(true);
788
788
789
    msg("Loading resource");
789
    msg("Loading resource");
790
    final CDOResource resourceB = viewB.getResource("/test1");
790
    final CDOResource resourceB = viewB.getResource("/test1");
Lines 864-874 Link Here
864
864
865
    msg("Opening sessionB");
865
    msg("Opening sessionB");
866
    final CDOSession sessionB = openModel1Session();
866
    final CDOSession sessionB = openModel1Session();
867
    sessionB.setPassiveUpdateEnabled(false);
867
    sessionB.options().setPassiveUpdateEnabled(false);
868
868
869
    msg("Attaching viewB");
869
    msg("Attaching viewB");
870
    final CDOView viewB = sessionB.openTransaction();
870
    final CDOView viewB = sessionB.openTransaction();
871
    viewB.setInvalidationNotificationEnabled(true);
871
    viewB.options().setInvalidationNotificationEnabled(true);
872
872
873
    msg("Loading resource");
873
    msg("Loading resource");
874
    final CDOResource resourceB = viewB.getResource("/test1");
874
    final CDOResource resourceB = viewB.getResource("/test1");
(-)src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java (-1 / +1 lines)
Lines 128-134 Link Here
128
    CDORevision salesRevision = CDOUtil.getCDOObject(salesOrder2).cdoRevision();
128
    CDORevision salesRevision = CDOUtil.getCDOObject(salesOrder2).cdoRevision();
129
    CDOFeature customerFeature = session.getPackageManager().convert(getModel1Package().getSalesOrder_Customer());
129
    CDOFeature customerFeature = session.getPackageManager().convert(getModel1Package().getSalesOrder_Customer());
130
130
131
    Object value = salesRevision.getData().get(customerFeature, 0);
131
    Object value = salesRevision.data().get(customerFeature, 0);
132
    Assert.assertEquals(true, value instanceof CDOID);
132
    Assert.assertEquals(true, value instanceof CDOID);
133
    transaction2.close();
133
    transaction2.close();
134
    session.close();
134
    session.close();
(-)src/org/eclipse/emf/cdo/tests/ViewTest.java (-10 / +10 lines)
Lines 97-103 Link Here
97
    }
97
    }
98
98
99
    CDOSession session = openModel1Session();
99
    CDOSession session = openModel1Session();
100
    session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(2, 2));
100
    session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(2, 2));
101
101
102
    CDOTransaction transaction = session.openTransaction();
102
    CDOTransaction transaction = session.openTransaction();
103
103
Lines 110-116 Link Here
110
      contents.add(company);
110
      contents.add(company);
111
    }
111
    }
112
112
113
    CDORevisionData revision = resource.cdoRevision().getData();
113
    CDORevisionData revision = resource.cdoRevision().data();
114
    CDOResourcePackage resourcePackage = session.getPackageManager().getCDOResourcePackage();
114
    CDOResourcePackage resourcePackage = session.getPackageManager().getCDOResourcePackage();
115
    CDOContentsFeature contentsFeature = resourcePackage.getCDOResourceClass().getCDOContentsFeature();
115
    CDOContentsFeature contentsFeature = resourcePackage.getCDOResourceClass().getCDOContentsFeature();
116
    assertEquals(true, revision.get(contentsFeature, 99) instanceof CDOElementProxy);
116
    assertEquals(true, revision.get(contentsFeature, 99) instanceof CDOElementProxy);
Lines 137-143 Link Here
137
    }
137
    }
138
138
139
    CDOSession session = openModel1Session();
139
    CDOSession session = openModel1Session();
140
    session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(2, 2));
140
    session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(2, 2));
141
141
142
    CDOTransaction transaction = session.openTransaction();
142
    CDOTransaction transaction = session.openTransaction();
143
143
Lines 150-156 Link Here
150
      contents.add(company);
150
      contents.add(company);
151
    }
151
    }
152
152
153
    CDORevisionData revision = resource.cdoRevision().getData();
153
    CDORevisionData revision = resource.cdoRevision().data();
154
    CDOResourcePackage resourcePackage = session.getPackageManager().getCDOResourcePackage();
154
    CDOResourcePackage resourcePackage = session.getPackageManager().getCDOResourcePackage();
155
    CDOContentsFeature contentsFeature = resourcePackage.getCDOResourceClass().getCDOContentsFeature();
155
    CDOContentsFeature contentsFeature = resourcePackage.getCDOResourceClass().getCDOContentsFeature();
156
    assertEquals(false, revision.get(contentsFeature, 0) instanceof CDOElementProxy);
156
    assertEquals(false, revision.get(contentsFeature, 0) instanceof CDOElementProxy);
Lines 229-250 Link Here
229
    transaction.createResource("/my/test5");
229
    transaction.createResource("/my/test5");
230
230
231
    boolean done;
231
    boolean done;
232
    done = transaction.setCacheReferenceType(ReferenceType.SOFT);
232
    done = transaction.options().setCacheReferenceType(ReferenceType.SOFT);
233
    assertEquals(false, done);
233
    assertEquals(false, done);
234
234
235
    done = transaction.setCacheReferenceType(null);
235
    done = transaction.options().setCacheReferenceType(null);
236
    assertEquals(false, done);
236
    assertEquals(false, done);
237
237
238
    done = transaction.setCacheReferenceType(ReferenceType.STRONG);
238
    done = transaction.options().setCacheReferenceType(ReferenceType.STRONG);
239
    assertEquals(true, done);
239
    assertEquals(true, done);
240
240
241
    done = transaction.setCacheReferenceType(ReferenceType.SOFT);
241
    done = transaction.options().setCacheReferenceType(ReferenceType.SOFT);
242
    assertEquals(true, done);
242
    assertEquals(true, done);
243
243
244
    done = transaction.setCacheReferenceType(ReferenceType.WEAK);
244
    done = transaction.options().setCacheReferenceType(ReferenceType.WEAK);
245
    assertEquals(true, done);
245
    assertEquals(true, done);
246
246
247
    done = transaction.setCacheReferenceType(null);
247
    done = transaction.options().setCacheReferenceType(null);
248
    assertEquals(true, done);
248
    assertEquals(true, done);
249
249
250
    session.close();
250
    session.close();
(-)src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java (-2 / +2 lines)
Lines 69-75 Link Here
69
69
70
    msg("Opening session");
70
    msg("Opening session");
71
    CDOSession session = openModel1Session();
71
    CDOSession session = openModel1Session();
72
    session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
72
    session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
73
73
74
    msg("Attaching transaction");
74
    msg("Attaching transaction");
75
    CDOTransaction transaction = session.openTransaction();
75
    CDOTransaction transaction = session.openTransaction();
Lines 128-134 Link Here
128
128
129
    msg("Opening session");
129
    msg("Opening session");
130
    CDOSession session = openModel1Session();
130
    CDOSession session = openModel1Session();
131
    session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
131
    session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10));
132
132
133
    msg("Attaching transaction");
133
    msg("Attaching transaction");
134
    CDOTransaction transaction = session.openTransaction();
134
    CDOTransaction transaction = session.openTransaction();
(-)src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java (-2 / +2 lines)
Lines 341-347 Link Here
341
      throw new UnsupportedOperationException();
341
      throw new UnsupportedOperationException();
342
    }
342
    }
343
343
344
    public CDORevisionData getData()
344
    public CDORevisionData data()
345
    {
345
    {
346
      throw new UnsupportedOperationException();
346
      throw new UnsupportedOperationException();
347
    }
347
    }
Lines 431-437 Link Here
431
      throw new UnsupportedOperationException();
431
      throw new UnsupportedOperationException();
432
    }
432
    }
433
433
434
    public CDORevision getRevision()
434
    public CDORevision revision()
435
    {
435
    {
436
      throw new UnsupportedOperationException();
436
      throw new UnsupportedOperationException();
437
    }
437
    }
(-)src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java (-1 / +1 lines)
Lines 95-101 Link Here
95
    InternalCDOTransaction transaction = (InternalCDOTransaction)session.openTransaction();
95
    InternalCDOTransaction transaction = (InternalCDOTransaction)session.openTransaction();
96
    CDOFeatureAnalyzerModelBased featureanalyzerModelBased = new CDOFeatureAnalyzerModelBased();
96
    CDOFeatureAnalyzerModelBased featureanalyzerModelBased = new CDOFeatureAnalyzerModelBased();
97
    transaction.setFeatureAnalyzer(featureanalyzerModelBased);
97
    transaction.setFeatureAnalyzer(featureanalyzerModelBased);
98
    transaction.setRevisionPrefetchingPolicy(CDOUtil.createRevisionPrefetchingPolicy(10));
98
    transaction.options().setRevisionPrefetchingPolicy(CDOUtil.createRevisionPrefetchingPolicy(10));
99
99
100
    msg("Getting resource");
100
    msg("Getting resource");
101
101
(-)src/org/eclipse/emf/cdo/tests/AuditTest.java (-12 / +12 lines)
Lines 68-88 Link Here
68
    resource.getContents().add(company);
68
    resource.getContents().add(company);
69
    transaction.commit();
69
    transaction.commit();
70
    long commitTime1 = transaction.getLastCommitTime();
70
    long commitTime1 = transaction.getLastCommitTime();
71
    assertTrue(session.getRepositoryCreationTime() < commitTime1);
71
    assertTrue(session.repository().getCreationTime() < commitTime1);
72
    assertEquals("ESC", company.getName());
72
    assertEquals("ESC", company.getName());
73
73
74
    company.setName("Sympedia");
74
    company.setName("Sympedia");
75
    transaction.commit();
75
    transaction.commit();
76
    long commitTime2 = transaction.getLastCommitTime();
76
    long commitTime2 = transaction.getLastCommitTime();
77
    assertTrue(commitTime1 < commitTime2);
77
    assertTrue(commitTime1 < commitTime2);
78
    assertTrue(session.getRepositoryCreationTime() < commitTime2);
78
    assertTrue(session.repository().getCreationTime() < commitTime2);
79
    assertEquals("Sympedia", company.getName());
79
    assertEquals("Sympedia", company.getName());
80
80
81
    company.setName("Eclipse");
81
    company.setName("Eclipse");
82
    transaction.commit();
82
    transaction.commit();
83
    long commitTime3 = transaction.getLastCommitTime();
83
    long commitTime3 = transaction.getLastCommitTime();
84
    assertTrue(commitTime2 < commitTime3);
84
    assertTrue(commitTime2 < commitTime3);
85
    assertTrue(session.getRepositoryCreationTime() < commitTime2);
85
    assertTrue(session.repository().getCreationTime() < commitTime2);
86
    assertEquals("Eclipse", company.getName());
86
    assertEquals("Eclipse", company.getName());
87
87
88
    closeSession1();
88
    closeSession1();
Lines 111-131 Link Here
111
    resource.getContents().add(company);
111
    resource.getContents().add(company);
112
    transaction.commit();
112
    transaction.commit();
113
    long commitTime1 = transaction.getLastCommitTime();
113
    long commitTime1 = transaction.getLastCommitTime();
114
    assertTrue(session.getRepositoryCreationTime() < commitTime1);
114
    assertTrue(session.repository().getCreationTime() < commitTime1);
115
    assertEquals("ESC", company.getName());
115
    assertEquals("ESC", company.getName());
116
116
117
    company.setName("Sympedia");
117
    company.setName("Sympedia");
118
    transaction.commit();
118
    transaction.commit();
119
    long commitTime2 = transaction.getLastCommitTime();
119
    long commitTime2 = transaction.getLastCommitTime();
120
    assertTrue(commitTime1 < commitTime2);
120
    assertTrue(commitTime1 < commitTime2);
121
    assertTrue(session.getRepositoryCreationTime() < commitTime2);
121
    assertTrue(session.repository().getCreationTime() < commitTime2);
122
    assertEquals("Sympedia", company.getName());
122
    assertEquals("Sympedia", company.getName());
123
123
124
    company.setName("Eclipse");
124
    company.setName("Eclipse");
125
    transaction.commit();
125
    transaction.commit();
126
    long commitTime3 = transaction.getLastCommitTime();
126
    long commitTime3 = transaction.getLastCommitTime();
127
    assertTrue(commitTime2 < commitTime3);
127
    assertTrue(commitTime2 < commitTime3);
128
    assertTrue(session.getRepositoryCreationTime() < commitTime2);
128
    assertTrue(session.repository().getCreationTime() < commitTime2);
129
    assertEquals("Eclipse", company.getName());
129
    assertEquals("Eclipse", company.getName());
130
130
131
    closeSession1();
131
    closeSession1();
Lines 166-186 Link Here
166
    resource.getContents().add(company);
166
    resource.getContents().add(company);
167
    transaction.commit();
167
    transaction.commit();
168
    long commitTime1 = transaction.getLastCommitTime();
168
    long commitTime1 = transaction.getLastCommitTime();
169
    assertTrue(session.getRepositoryCreationTime() < commitTime1);
169
    assertTrue(session.repository().getCreationTime() < commitTime1);
170
    assertEquals("ESC", company.getName());
170
    assertEquals("ESC", company.getName());
171
171
172
    company.setName("Sympedia");
172
    company.setName("Sympedia");
173
    transaction.commit();
173
    transaction.commit();
174
    long commitTime2 = transaction.getLastCommitTime();
174
    long commitTime2 = transaction.getLastCommitTime();
175
    assertTrue(commitTime1 < commitTime2);
175
    assertTrue(commitTime1 < commitTime2);
176
    assertTrue(session.getRepositoryCreationTime() < commitTime2);
176
    assertTrue(session.repository().getCreationTime() < commitTime2);
177
    assertEquals("Sympedia", company.getName());
177
    assertEquals("Sympedia", company.getName());
178
178
179
    company.setName("Eclipse");
179
    company.setName("Eclipse");
180
    transaction.commit();
180
    transaction.commit();
181
    long commitTime3 = transaction.getLastCommitTime();
181
    long commitTime3 = transaction.getLastCommitTime();
182
    assertTrue(commitTime2 < commitTime3);
182
    assertTrue(commitTime2 < commitTime3);
183
    assertTrue(session.getRepositoryCreationTime() < commitTime2);
183
    assertTrue(session.repository().getCreationTime() < commitTime2);
184
    assertEquals("Eclipse", company.getName());
184
    assertEquals("Eclipse", company.getName());
185
185
186
    closeSession1();
186
    closeSession1();
Lines 322-328 Link Here
322
    closeSession1();
322
    closeSession1();
323
323
324
    session = openSession2();
324
    session = openSession2();
325
    session.openAudit(session.getRepositoryCreationTime());
325
    session.openAudit(session.repository().getCreationTime());
326
    session.close();
326
    session.close();
327
  }
327
  }
328
328
Lines 463-469 Link Here
463
    public void testRepositoryCreationTime() throws Exception
463
    public void testRepositoryCreationTime() throws Exception
464
    {
464
    {
465
      CDOSession session = openSession();
465
      CDOSession session = openSession();
466
      long repositoryCreationTime = session.getRepositoryCreationTime();
466
      long repositoryCreationTime = session.repository().getCreationTime();
467
      assertEquals(getRepository().getCreationTime(), repositoryCreationTime);
467
      assertEquals(getRepository().getCreationTime(), repositoryCreationTime);
468
      assertEquals(getRepository().getStore().getCreationTime(), repositoryCreationTime);
468
      assertEquals(getRepository().getStore().getCreationTime(), repositoryCreationTime);
469
    }
469
    }
Lines 471-477 Link Here
471
    public void testRepositoryTime() throws Exception
471
    public void testRepositoryTime() throws Exception
472
    {
472
    {
473
      CDOSession session = openSession();
473
      CDOSession session = openSession();
474
      long repositoryTime = session.getRepositoryTime();
474
      long repositoryTime = session.repository().getCurrentTime();
475
      assertTrue(Math.abs(System.currentTimeMillis() - repositoryTime) < 500);
475
      assertTrue(Math.abs(System.currentTimeMillis() - repositoryTime) < 500);
476
    }
476
    }
477
477
(-)src/org/eclipse/emf/cdo/tests/LockingManagerTest.java (-4 / +4 lines)
Lines 469-475 Link Here
469
    CDOResource res = transaction.createResource("/res1");
469
    CDOResource res = transaction.createResource("/res1");
470
    res.getContents().add(company);
470
    res.getContents().add(company);
471
    transaction.commit();
471
    transaction.commit();
472
    transaction.setAutoReleaseLocksEnabled(false);
472
    transaction.options().setAutoReleaseLocksEnabled(false);
473
473
474
    CDOObject cdoCompany = CDOUtil.getCDOObject(company);
474
    CDOObject cdoCompany = CDOUtil.getCDOObject(company);
475
    cdoCompany.cdoWriteLock().lock();
475
    cdoCompany.cdoWriteLock().lock();
Lines 495-501 Link Here
495
    transaction.commit();
495
    transaction.commit();
496
    assertEquals(true, cdoCompany.cdoReadLock().isLocked());
496
    assertEquals(true, cdoCompany.cdoReadLock().isLocked());
497
497
498
    transaction.setAutoReleaseLocksEnabled(true);
498
    transaction.options().setAutoReleaseLocksEnabled(true);
499
    transaction.commit();
499
    transaction.commit();
500
    assertEquals(false, cdoCompany.cdoReadLock().isLocked());
500
    assertEquals(false, cdoCompany.cdoReadLock().isLocked());
501
  }
501
  }
Lines 509-515 Link Here
509
    CDOResource res = transaction.createResource("/res1");
509
    CDOResource res = transaction.createResource("/res1");
510
    res.getContents().add(company);
510
    res.getContents().add(company);
511
    transaction.commit();
511
    transaction.commit();
512
    transaction.setAutoReleaseLocksEnabled(false);
512
    transaction.options().setAutoReleaseLocksEnabled(false);
513
513
514
    CDOObject cdoCompany = CDOUtil.getCDOObject(company);
514
    CDOObject cdoCompany = CDOUtil.getCDOObject(company);
515
    cdoCompany.cdoWriteLock().lock();
515
    cdoCompany.cdoWriteLock().lock();
Lines 535-541 Link Here
535
    transaction.rollback();
535
    transaction.rollback();
536
    assertEquals(true, cdoCompany.cdoReadLock().isLocked());
536
    assertEquals(true, cdoCompany.cdoReadLock().isLocked());
537
537
538
    transaction.setAutoReleaseLocksEnabled(true);
538
    transaction.options().setAutoReleaseLocksEnabled(true);
539
    transaction.rollback();
539
    transaction.rollback();
540
    assertEquals(false, cdoCompany.cdoReadLock().isLocked());
540
    assertEquals(false, cdoCompany.cdoReadLock().isLocked());
541
  }
541
  }
(-)src/org/eclipse/emf/cdo/tests/ResourceTest.java (-7 / +7 lines)
Lines 137-145 Link Here
137
    CDOObject cdoRootResource = CDOUtil.getCDOObject(transaction.getRootResource());
137
    CDOObject cdoRootResource = CDOUtil.getCDOObject(transaction.getRootResource());
138
    assertClean(cdoResource, transaction);
138
    assertClean(cdoResource, transaction);
139
    assertClean(cdoRootResource, transaction);
139
    assertClean(cdoRootResource, transaction);
140
    assertEquals(CDOID.NULL, cdoResource.cdoRevision().getData().getContainerID());
140
    assertEquals(CDOID.NULL, cdoResource.cdoRevision().data().getContainerID());
141
    assertEquals(cdoRootResource.cdoID(), cdoResource.cdoRevision().getData().getResourceID());
141
    assertEquals(cdoRootResource.cdoID(), cdoResource.cdoRevision().data().getResourceID());
142
    assertEquals(cdoRootResource.cdoID(), cdoRootResource.cdoRevision().getData().getResourceID());
142
    assertEquals(cdoRootResource.cdoID(), cdoRootResource.cdoRevision().data().getResourceID());
143
    assertEquals(true, transaction.getResourceSet().getResources().contains(resource));
143
    assertEquals(true, transaction.getResourceSet().getResources().contains(resource));
144
    assertEquals(true, transaction.getResourceSet().getResources().contains(transaction.getRootResource()));
144
    assertEquals(true, transaction.getResourceSet().getResources().contains(transaction.getRootResource()));
145
145
Lines 673-685 Link Here
673
673
674
      if (i == 0)
674
      if (i == 0)
675
      {
675
      {
676
        assertEquals(cdoRootResource.cdoID(), cdoResourceNode.cdoRevision().getData().getResourceID());
676
        assertEquals(cdoRootResource.cdoID(), cdoResourceNode.cdoRevision().data().getResourceID());
677
        assertEquals(CDOID.NULL, cdoResourceNode.cdoRevision().getData().getContainerID());
677
        assertEquals(CDOID.NULL, cdoResourceNode.cdoRevision().data().getContainerID());
678
      }
678
      }
679
      else
679
      else
680
      {
680
      {
681
        assertEquals(CDOID.NULL, cdoResourceNode.cdoRevision().getData().getResourceID());
681
        assertEquals(CDOID.NULL, cdoResourceNode.cdoRevision().data().getResourceID());
682
        assertEquals(cdoParent.cdoID(), cdoResourceNode.cdoRevision().getData().getContainerID());
682
        assertEquals(cdoParent.cdoID(), cdoResourceNode.cdoRevision().data().getContainerID());
683
      }
683
      }
684
684
685
      cdoParent = cdoResourceNode;
685
      cdoParent = cdoResourceNode;
(-)src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java (-18 / +18 lines)
Lines 52-58 Link Here
52
    msg("Opening session");
52
    msg("Opening session");
53
    final CDOSession session = openModel1Session();
53
    final CDOSession session = openModel1Session();
54
54
55
    session.setPassiveUpdateEnabled(false);
55
    session.options().setPassiveUpdateEnabled(false);
56
56
57
    // ************************************************************* //
57
    // ************************************************************* //
58
58
Lines 69-75 Link Here
69
    msg("Opening transaction");
69
    msg("Opening transaction");
70
    final CDOTransaction transaction = session.openTransaction();
70
    final CDOTransaction transaction = session.openTransaction();
71
71
72
    transaction.setChangeSubscriptionPolicy(enabled);
72
    transaction.options().setChangeSubscriptionPolicy(enabled);
73
73
74
    msg("Creating resource");
74
    msg("Creating resource");
75
    final CDOResource resourceA = transaction.createResource("/test1");
75
    final CDOResource resourceA = transaction.createResource("/test1");
Lines 113-119 Link Here
113
    // Switching policy to the other
113
    // Switching policy to the other
114
    final CDOAdapterPolicy enabled2 = enabled == CDOAdapterPolicy.ALL ? CDOAdapterPolicy.NONE : CDOAdapterPolicy.ALL;
114
    final CDOAdapterPolicy enabled2 = enabled == CDOAdapterPolicy.ALL ? CDOAdapterPolicy.NONE : CDOAdapterPolicy.ALL;
115
115
116
    transaction.setChangeSubscriptionPolicy(enabled2);
116
    transaction.options().setChangeSubscriptionPolicy(enabled2);
117
117
118
    adapter.getNotifications().clear();
118
    adapter.getNotifications().clear();
119
119
Lines 155-161 Link Here
155
    msg("Opening session");
155
    msg("Opening session");
156
    final CDOSession session = openModel1Session();
156
    final CDOSession session = openModel1Session();
157
157
158
    session.setPassiveUpdateEnabled(false);
158
    session.options().setPassiveUpdateEnabled(false);
159
159
160
    // ************************************************************* //
160
    // ************************************************************* //
161
161
Lines 171-177 Link Here
171
171
172
    msg("Opening transaction");
172
    msg("Opening transaction");
173
    final CDOTransaction transaction = session.openTransaction();
173
    final CDOTransaction transaction = session.openTransaction();
174
    transaction.setChangeSubscriptionPolicy(enabled);
174
    transaction.options().setChangeSubscriptionPolicy(enabled);
175
175
176
    msg("Creating resource");
176
    msg("Creating resource");
177
    final CDOResource resourceA = transaction.createResource("/test1");
177
    final CDOResource resourceA = transaction.createResource("/test1");
Lines 188-194 Link Here
188
188
189
    msg("Opening view");
189
    msg("Opening view");
190
    final CDOSession session2 = openModel1Session();
190
    final CDOSession session2 = openModel1Session();
191
    session2.setPassiveUpdateEnabled(false);
191
    session2.options().setPassiveUpdateEnabled(false);
192
192
193
    final CDOTransaction transaction2 = session2.openTransaction();
193
    final CDOTransaction transaction2 = session2.openTransaction();
194
194
Lines 218-224 Link Here
218
    // Switching policy to the other
218
    // Switching policy to the other
219
    final CDOAdapterPolicy enabled2 = enabled == CDOAdapterPolicy.ALL ? CDOAdapterPolicy.NONE : CDOAdapterPolicy.ALL;
219
    final CDOAdapterPolicy enabled2 = enabled == CDOAdapterPolicy.ALL ? CDOAdapterPolicy.NONE : CDOAdapterPolicy.ALL;
220
220
221
    transaction.setChangeSubscriptionPolicy(enabled2);
221
    transaction.options().setChangeSubscriptionPolicy(enabled2);
222
222
223
    adapter.getNotifications().clear();
223
    adapter.getNotifications().clear();
224
224
Lines 250-256 Link Here
250
    msg("Opening session");
250
    msg("Opening session");
251
    final CDOSession session = openModel1Session();
251
    final CDOSession session = openModel1Session();
252
252
253
    session.setPassiveUpdateEnabled(false);
253
    session.options().setPassiveUpdateEnabled(false);
254
254
255
    // ************************************************************* //
255
    // ************************************************************* //
256
256
Lines 266-272 Link Here
266
266
267
    msg("Opening transaction");
267
    msg("Opening transaction");
268
    final CDOTransaction transaction = session.openTransaction();
268
    final CDOTransaction transaction = session.openTransaction();
269
    transaction.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
269
    transaction.options().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
270
    msg("Creating resource");
270
    msg("Creating resource");
271
    final CDOResource resourceA = transaction.createResource("/test1");
271
    final CDOResource resourceA = transaction.createResource("/test1");
272
272
Lines 284-293 Link Here
284
284
285
    msg("Opening view");
285
    msg("Opening view");
286
    final CDOSession session2 = openModel1Session();
286
    final CDOSession session2 = openModel1Session();
287
    session2.setPassiveUpdateEnabled(false);
287
    session2.options().setPassiveUpdateEnabled(false);
288
288
289
    final CDOTransaction transaction2 = session2.openTransaction();
289
    final CDOTransaction transaction2 = session2.openTransaction();
290
    transaction.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
290
    transaction.options().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
291
291
292
    final Category category1B = (Category)transaction2.getObject(CDOUtil.getCDOObject(category1A).cdoID(), true);
292
    final Category category1B = (Category)transaction2.getObject(CDOUtil.getCDOObject(category1A).cdoID(), true);
293
293
Lines 320-326 Link Here
320
    msg("Opening session");
320
    msg("Opening session");
321
    final CDOSession session = openModel1Session();
321
    final CDOSession session = openModel1Session();
322
322
323
    session.setPassiveUpdateEnabled(false);
323
    session.options().setPassiveUpdateEnabled(false);
324
324
325
    // ************************************************************* //
325
    // ************************************************************* //
326
326
Lines 337-343 Link Here
337
    msg("Opening transaction");
337
    msg("Opening transaction");
338
    final CDOTransaction transaction = session.openTransaction();
338
    final CDOTransaction transaction = session.openTransaction();
339
339
340
    transaction.setChangeSubscriptionPolicy(customPolicy);
340
    transaction.options().setChangeSubscriptionPolicy(customPolicy);
341
341
342
    msg("Creating resource");
342
    msg("Creating resource");
343
    final CDOResource resourceA = transaction.createResource("/test1");
343
    final CDOResource resourceA = transaction.createResource("/test1");
Lines 359-365 Link Here
359
359
360
    msg("Opening view");
360
    msg("Opening view");
361
    final CDOSession session2 = openModel1Session();
361
    final CDOSession session2 = openModel1Session();
362
    session2.setPassiveUpdateEnabled(false);
362
    session2.options().setPassiveUpdateEnabled(false);
363
363
364
    final CDOTransaction transaction2 = session2.openTransaction();
364
    final CDOTransaction transaction2 = session2.openTransaction();
365
365
Lines 388-394 Link Here
388
    assertEquals(false, timedOut);
388
    assertEquals(false, timedOut);
389
389
390
    // Switching policy to the other
390
    // Switching policy to the other
391
    transaction.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
391
    transaction.options().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
392
392
393
    adapter.getNotifications().clear();
393
    adapter.getNotifications().clear();
394
394
Lines 420-426 Link Here
420
    msg("Opening session");
420
    msg("Opening session");
421
    final CDOSession session = openModel1Session();
421
    final CDOSession session = openModel1Session();
422
422
423
    session.setPassiveUpdateEnabled(false);
423
    session.options().setPassiveUpdateEnabled(false);
424
424
425
    // ************************************************************* //
425
    // ************************************************************* //
426
426
Lines 437-443 Link Here
437
    msg("Opening transaction");
437
    msg("Opening transaction");
438
    final CDOTransaction transaction = session.openTransaction();
438
    final CDOTransaction transaction = session.openTransaction();
439
439
440
    transaction.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
440
    transaction.options().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL);
441
441
442
    msg("Creating resource");
442
    msg("Creating resource");
443
    final CDOResource resourceA = transaction.createResource("/test1");
443
    final CDOResource resourceA = transaction.createResource("/test1");
Lines 456-462 Link Here
456
456
457
    msg("Opening view");
457
    msg("Opening view");
458
    final CDOSession session2 = openModel1Session();
458
    final CDOSession session2 = openModel1Session();
459
    session2.setPassiveUpdateEnabled(false);
459
    session2.options().setPassiveUpdateEnabled(false);
460
460
461
    final CDOTransaction transaction2 = session2.openTransaction();
461
    final CDOTransaction transaction2 = session2.openTransaction();
462
462
(-)src/org/eclipse/emf/cdo/tests/StateMachineTest.java (-1 / +1 lines)
Lines 51-57 Link Here
51
    CDOTransaction transaction = session.openTransaction();
51
    CDOTransaction transaction = session.openTransaction();
52
    CDOResource resource = transaction.createResource("/test1");
52
    CDOResource resource = transaction.createResource("/test1");
53
    assertNew(resource, transaction);
53
    assertNew(resource, transaction);
54
    assertEquals(URI.createURI("cdo://" + session.getRepositoryUUID() + "/test1"), resource.getURI());
54
    assertEquals(URI.createURI("cdo://" + session.repository().getUUID() + "/test1"), resource.getURI());
55
    assertEquals(transaction.getResourceSet(), resource.getResourceSet());
55
    assertEquals(transaction.getResourceSet(), resource.getResourceSet());
56
56
57
    // Attach single object
57
    // Attach single object
(-)src/org/eclipse/emf/cdo/tests/RollbackTest.java (-3 / +3 lines)
Lines 82-94 Link Here
82
    CDOObject cdoObjectProduct1 = CDOUtil.getCDOObject(product1);
82
    CDOObject cdoObjectProduct1 = CDOUtil.getCDOObject(product1);
83
83
84
    msg("Object should contains internalEObject");
84
    msg("Object should contains internalEObject");
85
    Object testObject = cdoObjectCategory1.cdoRevision().getData().get(category_Products1, 0);
85
    Object testObject = cdoObjectCategory1.cdoRevision().data().get(category_Products1, 0);
86
    assertEquals(product1, testObject);
86
    assertEquals(product1, testObject);
87
87
88
    transaction1.commit();
88
    transaction1.commit();
89
89
90
    msg("Object should contains CDOID");
90
    msg("Object should contains CDOID");
91
    testObject = cdoObjectCategory1.cdoRevision().getData().get(category_Products1, 0);
91
    testObject = cdoObjectCategory1.cdoRevision().data().get(category_Products1, 0);
92
    assertEquals(cdoObjectProduct1.cdoID(), testObject);
92
    assertEquals(cdoObjectProduct1.cdoID(), testObject);
93
93
94
    sleep(500);
94
    sleep(500);
Lines 106-112 Link Here
106
    {
106
    {
107
      // Commit process should no have changed state of the object
107
      // Commit process should no have changed state of the object
108
      CDOObject cdoObjectCategory2 = CDOUtil.getCDOObject(category2);
108
      CDOObject cdoObjectCategory2 = CDOUtil.getCDOObject(category2);
109
      testObject = cdoObjectCategory2.cdoRevision().getData().get(category_Products2, 0);
109
      testObject = cdoObjectCategory2.cdoRevision().data().get(category_Products2, 0);
110
      assertEquals(product2, testObject);
110
      assertEquals(product2, testObject);
111
      transaction2.rollback();
111
      transaction2.rollback();
112
    }
112
    }
(-)src/org/eclipse/emf/cdo/tests/SessionTest.java (-1 / +1 lines)
Lines 20-26 Link Here
20
  public void testIsSupportingAudits() throws Exception
20
  public void testIsSupportingAudits() throws Exception
21
  {
21
  {
22
    CDOSession session = openModel1Session();
22
    CDOSession session = openModel1Session();
23
    assertEquals(getRepository().isSupportingAudits(), session.isRepositorySupportingAudits());
23
    assertEquals(getRepository().isSupportingAudits(), session.repository().isSupportingAudits());
24
    session.close();
24
    session.close();
25
  }
25
  }
26
}
26
}
(-)src/org/eclipse/emf/cdo/tests/InitialTest.java (-5 / +5 lines)
Lines 126-132 Link Here
126
    msg("Opening session");
126
    msg("Opening session");
127
    CDOSession session = openModel1Session();
127
    CDOSession session = openModel1Session();
128
    assertNotNull(session);
128
    assertNotNull(session);
129
    assertEquals(true, session.isOpen());
129
    assertEquals(false, session.isClosed());
130
  }
130
  }
131
131
132
  public void testStartTransaction() throws Exception
132
  public void testStartTransaction() throws Exception
Lines 151-157 Link Here
151
    msg("Creating resource");
151
    msg("Creating resource");
152
    CDOResource resource = transaction.createResource("/test1");
152
    CDOResource resource = transaction.createResource("/test1");
153
    assertNew(resource, transaction);
153
    assertNew(resource, transaction);
154
    assertEquals(URI.createURI("cdo://" + session.getRepositoryUUID() + "/test1"), resource.getURI());
154
    assertEquals(URI.createURI("cdo://" + session.repository().getUUID() + "/test1"), resource.getURI());
155
    ResourceSet expected = transaction.getResourceSet();
155
    ResourceSet expected = transaction.getResourceSet();
156
    ResourceSet actual = resource.getResourceSet();
156
    ResourceSet actual = resource.getResourceSet();
157
    assertEquals(expected, actual);
157
    assertEquals(expected, actual);
Lines 474-480 Link Here
474
      msg("Getting resource");
474
      msg("Getting resource");
475
      CDOResource resource = transaction.getResource("/test1", true);
475
      CDOResource resource = transaction.getResource("/test1", true);
476
      assertNotNull(resource);
476
      assertNotNull(resource);
477
      assertEquals(URI.createURI("cdo://" + session.getRepositoryUUID() + "/test1"), resource.getURI());
477
      assertEquals(URI.createURI("cdo://" + session.repository().getUUID() + "/test1"), resource.getURI());
478
      assertEquals(transaction.getResourceSet(), resource.getResourceSet());
478
      assertEquals(transaction.getResourceSet(), resource.getResourceSet());
479
      assertEquals(1, transaction.getResourceSet().getResources().size());
479
      assertEquals(1, transaction.getResourceSet().getResources().size());
480
      assertEquals(CDOState.CLEAN, resource.cdoState());
480
      assertEquals(CDOState.CLEAN, resource.cdoState());
Lines 490-496 Link Here
490
      CDOResource resource = (CDOResource)transaction.getResourceSet().getResource(
490
      CDOResource resource = (CDOResource)transaction.getResourceSet().getResource(
491
          CDOURIUtil.createResourceURI(transaction, "/test1"), true);
491
          CDOURIUtil.createResourceURI(transaction, "/test1"), true);
492
      assertNotNull(resource);
492
      assertNotNull(resource);
493
      assertEquals(URI.createURI("cdo://" + session.getRepositoryUUID() + "/test1"), resource.getURI());
493
      assertEquals(URI.createURI("cdo://" + session.repository().getUUID() + "/test1"), resource.getURI());
494
      assertEquals(transaction.getResourceSet(), resource.getResourceSet());
494
      assertEquals(transaction.getResourceSet(), resource.getResourceSet());
495
      assertEquals(1, transaction.getResourceSet().getResources().size());
495
      assertEquals(1, transaction.getResourceSet().getResources().size());
496
      assertEquals(CDOState.CLEAN, resource.cdoState());
496
      assertEquals(CDOState.CLEAN, resource.cdoState());
Lines 671-677 Link Here
671
    msg("Getting resource");
671
    msg("Getting resource");
672
    CDOResource resource = transaction.getResource("/test1");
672
    CDOResource resource = transaction.getResource("/test1");
673
    assertNotNull(resource);
673
    assertNotNull(resource);
674
    assertEquals(URI.createURI("cdo://" + session.getRepositoryUUID() + "/test1"), resource.getURI());
674
    assertEquals(URI.createURI("cdo://" + session.repository().getUUID() + "/test1"), resource.getURI());
675
    assertEquals(transaction.getResourceSet(), resource.getResourceSet());
675
    assertEquals(transaction.getResourceSet(), resource.getResourceSet());
676
    assertEquals(CDOState.CLEAN, resource.cdoState());
676
    assertEquals(CDOState.CLEAN, resource.cdoState());
677
    assertEquals(transaction, resource.cdoView());
677
    assertEquals(transaction, resource.cdoView());
(-)src/org/eclipse/emf/cdo/internal/server/Session.java (-1 / +11 lines)
Lines 14-19 Link Here
14
 **************************************************************************/
14
 **************************************************************************/
15
package org.eclipse.emf.cdo.internal.server;
15
package org.eclipse.emf.cdo.internal.server;
16
16
17
import org.eclipse.emf.cdo.common.CDOProtocolSession;
17
import org.eclipse.emf.cdo.common.id.CDOID;
18
import org.eclipse.emf.cdo.common.id.CDOID;
18
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
19
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
19
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
20
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
Lines 56-62 Link Here
56
/**
57
/**
57
 * @author Eike Stepper
58
 * @author Eike Stepper
58
 */
59
 */
59
public class Session extends Container<IView> implements ISession, CDOIDProvider, CDOPackageURICompressor
60
public class Session extends Container<IView> implements ISession, CDOIDProvider, CDOPackageURICompressor,
61
    CDOProtocolSession.Options
60
{
62
{
61
  private SessionManager sessionManager;
63
  private SessionManager sessionManager;
62
64
Lines 102-107 Link Here
102
    }
104
    }
103
  }
105
  }
104
106
107
  /**
108
   * @since 2.0
109
   */
110
  public Options options()
111
  {
112
    return this;
113
  }
114
105
  public SessionManager getSessionManager()
115
  public SessionManager getSessionManager()
106
  {
116
  {
107
    return sessionManager;
117
    return sessionManager;
(-)src/org/eclipse/emf/cdo/internal/server/MEMStore.java (-4 / +4 lines)
Lines 177-184 Link Here
177
177
178
    if (revision.isResource())
178
    if (revision.isResource())
179
    {
179
    {
180
      CDOID revisionFolder = (CDOID)revision.getData().getContainerID();
180
      CDOID revisionFolder = (CDOID)revision.data().getContainerID();
181
      String revisionName = (String)revision.getData().get(getResourceNameFeature(), 0);
181
      String revisionName = (String)revision.data().get(getResourceNameFeature(), 0);
182
182
183
      IStoreAccessor accessor = StoreThreadLocal.getAccessor();
183
      IStoreAccessor accessor = StoreThreadLocal.getAccessor();
184
      CDOID resourceID = accessor.readResourceID(revisionFolder, revisionName, revision.getCreated());
184
      CDOID resourceID = accessor.readResourceID(revisionFolder, revisionName, revision.getCreated());
Lines 261-270 Link Here
261
          revision = getRevisionByTime(list, context.getTimeStamp());
261
          revision = getRevisionByTime(list, context.getTimeStamp());
262
          if (revision != null)
262
          if (revision != null)
263
          {
263
          {
264
            CDOID revisionFolder = (CDOID)revision.getData().getContainerID();
264
            CDOID revisionFolder = (CDOID)revision.data().getContainerID();
265
            if (CDOIDUtil.equals(revisionFolder, folderID))
265
            if (CDOIDUtil.equals(revisionFolder, folderID))
266
            {
266
            {
267
              String revisionName = (String)revision.getData().get(getResourceNameFeature(), 0);
267
              String revisionName = (String)revision.data().get(getResourceNameFeature(), 0);
268
              boolean match = exactMatch || revisionName == null || name == null ? ObjectUtil
268
              boolean match = exactMatch || revisionName == null || name == null ? ObjectUtil
269
                  .equals(revisionName, name) : revisionName.startsWith(name);
269
                  .equals(revisionName, name) : revisionName.startsWith(name);
270
270
(-)src/org/eclipse/emf/cdo/common/revision/CDORevisionData.java (-1 / +4 lines)
Lines 19-25 Link Here
19
 */
19
 */
20
public interface CDORevisionData
20
public interface CDORevisionData
21
{
21
{
22
  public CDORevision getRevision();
22
  /**
23
   * @since 2.0
24
   */
25
  public CDORevision revision();
23
26
24
  public CDOID getResourceID();
27
  public CDOID getResourceID();
25
28
(-)src/org/eclipse/emf/cdo/common/revision/CDORevision.java (-1 / +4 lines)
Lines 58-64 Link Here
58
58
59
  public boolean isResource();
59
  public boolean isResource();
60
60
61
  public CDORevisionData getData();
61
  /**
62
   * @since 2.0
63
   */
64
  public CDORevisionData data();
62
65
63
  public CDORevisionDelta compare(CDORevision origin);
66
  public CDORevisionDelta compare(CDORevision origin);
64
67
(-)src/org/eclipse/emf/cdo/internal/common/revision/delta/CDORevisionDeltaImpl.java (-9 / +9 lines)
Lines 84-91 Link Here
84
84
85
    compare(originRevision, dirtyRevision);
85
    compare(originRevision, dirtyRevision);
86
86
87
    CDORevisionData originData = originRevision.getData();
87
    CDORevisionData originData = originRevision.data();
88
    CDORevisionData dirtyData = dirtyRevision.getData();
88
    CDORevisionData dirtyData = dirtyRevision.data();
89
    if (!compare(originData.getContainerID(), dirtyData.getContainerID())
89
    if (!compare(originData.getContainerID(), dirtyData.getContainerID())
90
        || !compare(originData.getContainingFeatureID(), dirtyData.getContainingFeatureID())
90
        || !compare(originData.getContainingFeatureID(), dirtyData.getContainingFeatureID())
91
        || !compare(originData.getResourceID(), dirtyData.getResourceID()))
91
        || !compare(originData.getResourceID(), dirtyData.getResourceID()))
Lines 219-226 Link Here
219
      CDOFeature feature = features[i];
219
      CDOFeature feature = features[i];
220
      if (feature.isMany())
220
      if (feature.isMany())
221
      {
221
      {
222
        int originSize = originRevision.getData().size(feature);
222
        int originSize = originRevision.data().size(feature);
223
        int dirtySize = dirtyRevision.getData().size(feature);
223
        int dirtySize = dirtyRevision.data().size(feature);
224
        if (dirtySize == 0 && originSize > 0)
224
        if (dirtySize == 0 && originSize > 0)
225
        {
225
        {
226
          addFeatureDelta(new CDOClearFeatureDeltaImpl(feature));
226
          addFeatureDelta(new CDOClearFeatureDeltaImpl(feature));
Lines 233-240 Link Here
233
          {
233
          {
234
            for (; originIndex < originSize && dirtyIndex < dirtySize; dirtyIndex++, originIndex++)
234
            for (; originIndex < originSize && dirtyIndex < dirtySize; dirtyIndex++, originIndex++)
235
            {
235
            {
236
              Object originValue = originRevision.getData().get(feature, originIndex);
236
              Object originValue = originRevision.data().get(feature, originIndex);
237
              Object dirtyValue = dirtyRevision.getData().get(feature, dirtyIndex);
237
              Object dirtyValue = dirtyRevision.data().get(feature, dirtyIndex);
238
238
239
              if (!compare(originValue, dirtyValue))
239
              if (!compare(originValue, dirtyValue))
240
              {
240
              {
Lines 256-262 Link Here
256
256
257
            for (int k = 0; k < dirtySize; k++)
257
            for (int k = 0; k < dirtySize; k++)
258
            {
258
            {
259
              Object dirtyValue = dirtyRevision.getData().get(feature, k);
259
              Object dirtyValue = dirtyRevision.data().get(feature, k);
260
              addFeatureDelta(new CDOAddFeatureDeltaImpl(feature, k, dirtyValue));
260
              addFeatureDelta(new CDOAddFeatureDeltaImpl(feature, k, dirtyValue));
261
            }
261
            }
262
          }
262
          }
Lines 264-271 Link Here
264
      }
264
      }
265
      else
265
      else
266
      {
266
      {
267
        Object originValue = originRevision.getData().get(feature, 0);
267
        Object originValue = originRevision.data().get(feature, 0);
268
        Object dirtyValue = dirtyRevision.getData().get(feature, 0);
268
        Object dirtyValue = dirtyRevision.data().get(feature, 0);
269
        if (!compare(originValue, dirtyValue))
269
        if (!compare(originValue, dirtyValue))
270
        {
270
        {
271
          if (dirtyValue == null)
271
          if (dirtyValue == null)
(-)src/org/eclipse/emf/cdo/internal/common/revision/CDORevisionImpl.java (-2 / +2 lines)
Lines 287-298 Link Here
287
    return cdoClass.isResource();
287
    return cdoClass.isResource();
288
  }
288
  }
289
289
290
  public CDORevisionData getData()
290
  public CDORevisionData data()
291
  {
291
  {
292
    return this;
292
    return this;
293
  }
293
  }
294
294
295
  public CDORevision getRevision()
295
  public CDORevision revision()
296
  {
296
  {
297
    return this;
297
    return this;
298
  }
298
  }
(-)src/org/eclipse/emf/cdo/common/CDOProtocolSession.java (-3 / +12 lines)
Lines 27-41 Link Here
27
  /**
27
  /**
28
   * @since 2.0
28
   * @since 2.0
29
   */
29
   */
30
  public boolean isPassiveUpdateEnabled();
30
  public void close();
31
31
32
  /**
32
  /**
33
   * @since 2.0
33
   * @since 2.0
34
   */
34
   */
35
  public void close();
35
  public boolean isClosed();
36
36
37
  /**
37
  /**
38
   * @since 2.0
38
   * @since 2.0
39
   */
39
   */
40
  public boolean isClosed();
40
  public Options options();
41
42
  /**
43
   * @author Simon McDuff
44
   * @since 2.0
45
   */
46
  public interface Options
47
  {
48
    public boolean isPassiveUpdateEnabled();
49
  }
41
}
50
}
(-)src/org/eclipse/emf/cdo/server/internal/db/jdbc/StatementJDBCDelegate.java (-1 / +1 lines)
Lines 54-60 Link Here
54
54
55
    if (withFullRevisionInfo)
55
    if (withFullRevisionInfo)
56
    {
56
    {
57
      CDORevisionData data = revision.getData();
57
      CDORevisionData data = revision.data();
58
      builder.append(", ");
58
      builder.append(", ");
59
      builder.append(ServerInfo.getDBID(revision.getCDOClass()));
59
      builder.append(ServerInfo.getDBID(revision.getCDOClass()));
60
      builder.append(", ");
60
      builder.append(", ");
(-)src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java (-2 / +2 lines)
Lines 71-78 Link Here
71
      CDOResourceNodeClass resourceNodeClass = packageManager.getCDOResourcePackage().getCDOResourceNodeClass();
71
      CDOResourceNodeClass resourceNodeClass = packageManager.getCDOResourcePackage().getCDOResourceNodeClass();
72
      CDOFeature resourceNameFeature = resourceNodeClass.getCDONameFeature();
72
      CDOFeature resourceNameFeature = resourceNodeClass.getCDONameFeature();
73
73
74
      CDOID folderID = (CDOID)revision.getData().getContainerID();
74
      CDOID folderID = (CDOID)revision.data().getContainerID();
75
      String name = (String)revision.getData().get(resourceNameFeature, 0);
75
      String name = (String)revision.data().get(resourceNameFeature, 0);
76
76
77
      if (accessor.readResourceID(folderID, name, revision.getCreated()) != null)
77
      if (accessor.readResourceID(folderID, name, revision.getCreated()) != null)
78
      {
78
      {
(-)src/org/eclipse/emf/cdo/internal/ui/preferences/CDOPreferencePage.java (-22 / +2 lines)
Lines 13-25 Link Here
13
import org.eclipse.emf.cdo.CDOView;
13
import org.eclipse.emf.cdo.CDOView;
14
import org.eclipse.emf.cdo.common.revision.CDORevision;
14
import org.eclipse.emf.cdo.common.revision.CDORevision;
15
15
16
import org.eclipse.net4j.buffer.BufferInputStream;
17
import org.eclipse.net4j.util.ui.UIUtil;
16
import org.eclipse.net4j.util.ui.UIUtil;
18
import org.eclipse.net4j.util.ui.prefs.OMPreferencePage;
17
import org.eclipse.net4j.util.ui.prefs.OMPreferencePage;
19
import org.eclipse.net4j.util.ui.widgets.TextAndDisable;
18
import org.eclipse.net4j.util.ui.widgets.TextAndDisable;
20
19
21
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.SWT;
22
import org.eclipse.swt.layout.GridData;
23
import org.eclipse.swt.layout.GridLayout;
21
import org.eclipse.swt.layout.GridLayout;
24
import org.eclipse.swt.widgets.Button;
22
import org.eclipse.swt.widgets.Button;
25
import org.eclipse.swt.widgets.Composite;
23
import org.eclipse.swt.widgets.Composite;
Lines 45-52 Link Here
45
43
46
  private Button invalidationNotifications;
44
  private Button invalidationNotifications;
47
45
48
  private TextAndDisable commitTimeout;
49
50
  public CDOPreferencePage()
46
  public CDOPreferencePage()
51
  {
47
  {
52
    super(org.eclipse.emf.internal.cdo.bundle.OM.PREFS);
48
    super(org.eclipse.emf.internal.cdo.bundle.OM.PREFS);
Lines 86-92 Link Here
86
    viewGroup.setLayoutData(UIUtil.createGridData(true, false));
82
    viewGroup.setLayoutData(UIUtil.createGridData(true, false));
87
83
88
    new Label(viewGroup, SWT.NONE).setText("Preload chunk size:");
84
    new Label(viewGroup, SWT.NONE).setText("Preload chunk size:");
89
    preloadChunkSize = new TextAndDisable(viewGroup, SWT.BORDER, String.valueOf(CDOView.NO_REVISION_PREFETCHING));
85
    preloadChunkSize = new TextAndDisable(viewGroup, SWT.BORDER, String
86
        .valueOf(CDOView.Options.NO_REVISION_PREFETCHING));
90
    preloadChunkSize.setLayoutData(UIUtil.createGridData(true, false));
87
    preloadChunkSize.setLayoutData(UIUtil.createGridData(true, false));
91
88
92
    new Label(viewGroup, SWT.NONE).setText("EMF invalidation notifications:");
89
    new Label(viewGroup, SWT.NONE).setText("EMF invalidation notifications:");
Lines 97-115 Link Here
97
    transactionGroup.setText("Transaction Defaults");
94
    transactionGroup.setText("Transaction Defaults");
98
    transactionGroup.setLayoutData(UIUtil.createGridData(true, false));
95
    transactionGroup.setLayoutData(UIUtil.createGridData(true, false));
99
96
100
    new Label(transactionGroup, SWT.NONE).setText("Commit timeout (millis):");
101
    commitTimeout = new TextAndDisable(transactionGroup, SWT.BORDER, String.valueOf(BufferInputStream.NO_TIMEOUT))
102
    {
103
      @Override
104
      protected GridData createTextLayoutData()
105
      {
106
        GridData gd = super.createTextLayoutData();
107
        gd.widthHint = 64;
108
        return gd;
109
      }
110
    };
111
    commitTimeout.setLayoutData(UIUtil.createGridData(true, false));
112
113
    initValues();
97
    initValues();
114
    return composite;
98
    return composite;
115
  }
99
  }
Lines 125-132 Link Here
125
        .getValue()));
109
        .getValue()));
126
    invalidationNotifications.setSelection(org.eclipse.emf.internal.cdo.bundle.OM.PREF_ENABLE_INVALIDATION_NOTIFICATION
110
    invalidationNotifications.setSelection(org.eclipse.emf.internal.cdo.bundle.OM.PREF_ENABLE_INVALIDATION_NOTIFICATION
127
        .getValue());
111
        .getValue());
128
    commitTimeout.setValue(String
129
        .valueOf(org.eclipse.emf.internal.cdo.bundle.OM.PREF_DEFAULT_COMMIT_TIMEOUT.getValue()));
130
  }
112
  }
131
113
132
  @Override
114
  @Override
Lines 141-148 Link Here
141
        .getValue()));
123
        .getValue()));
142
    org.eclipse.emf.internal.cdo.bundle.OM.PREF_ENABLE_INVALIDATION_NOTIFICATION.setValue(invalidationNotifications
124
    org.eclipse.emf.internal.cdo.bundle.OM.PREF_ENABLE_INVALIDATION_NOTIFICATION.setValue(invalidationNotifications
143
        .getSelection());
125
        .getSelection());
144
    org.eclipse.emf.internal.cdo.bundle.OM.PREF_DEFAULT_COMMIT_TIMEOUT.setValue(Long
145
        .parseLong(commitTimeout.getValue()));
146
    return super.performOk();
126
    return super.performOk();
147
  }
127
  }
148
}
128
}
(-)src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java (-2 / +2 lines)
Lines 77-83 Link Here
77
      return new Path(resourcePath).lastSegment();
77
      return new Path(resourcePath).lastSegment();
78
    }
78
    }
79
79
80
    return view.getSession().getRepositoryName();
80
    return view.getSession().repository().getName();
81
  }
81
  }
82
82
83
  public IPersistableElement getPersistable()
83
  public IPersistableElement getPersistable()
Lines 88-94 Link Here
88
  public String getToolTipText()
88
  public String getToolTipText()
89
  {
89
  {
90
    CDOSession session = view.getSession();
90
    CDOSession session = view.getSession();
91
    String repositoryName = session.getRepositoryName();
91
    String repositoryName = session.repository().getName();
92
92
93
    StringBuilder builder = new StringBuilder();
93
    StringBuilder builder = new StringBuilder();
94
    builder.append(repositoryName);
94
    builder.append(repositoryName);
(-)src/org/eclipse/emf/cdo/ui/CDOItemProvider.java (-1 / +1 lines)
Lines 154-160 Link Here
154
154
155
  public static String getSessionLabel(CDOSession session)
155
  public static String getSessionLabel(CDOSession session)
156
  {
156
  {
157
    return "Session " + session.getRepositoryName() + " [" + session.getSessionID() + "]";
157
    return "Session " + session.repository().getName() + " [" + session.getSessionID() + "]";
158
  }
158
  }
159
159
160
  public static String getViewLabel(CDOView view)
160
  public static String getViewLabel(CDOView view)
(-)src/org/eclipse/emf/cdo/server/internal/hibernate/tuplizer/CDORevisionProxy.java (-4 / +4 lines)
Lines 100-108 Link Here
100
    return li.getRevision().getCreated();
100
    return li.getRevision().getCreated();
101
  }
101
  }
102
102
103
  public CDORevisionData getData()
103
  public CDORevisionData data()
104
  {
104
  {
105
    return li.getRevision().getData();
105
    return li.getRevision().data();
106
  }
106
  }
107
107
108
  public CDOID getID()
108
  public CDOID getID()
Lines 135-143 Link Here
135
    return li.getRevision().getRevised();
135
    return li.getRevision().getRevised();
136
  }
136
  }
137
137
138
  public CDORevision getRevision()
138
  public CDORevision revision()
139
  {
139
  {
140
    return li.getRevision().getRevision();
140
    return li.getRevision().revision();
141
  }
141
  }
142
142
143
  public Object getValue(CDOFeature feature)
143
  public Object getValue(CDOFeature feature)
(-)src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStoreAccessor.java (-1 / +1 lines)
Lines 290-296 Link Here
290
    for (Object o : result)
290
    for (Object o : result)
291
    {
291
    {
292
      final CDORevision revision = (CDORevision)o;
292
      final CDORevision revision = (CDORevision)o;
293
      String revisionName = (String)revision.getData().get(getResourceNameFeature(), 0);
293
      String revisionName = (String)revision.data().get(getResourceNameFeature(), 0);
294
      boolean match = exactMatch || revisionName == null || name == null ? ObjectUtil.equals(revisionName, name)
294
      boolean match = exactMatch || revisionName == null || name == null ? ObjectUtil.equals(revisionName, name)
295
          : revisionName.startsWith(name);
295
          : revisionName.startsWith(name);
296
296

Return to bug 257270