|
Re: [CDO] Could a ResourceSet share the same CDOView? [message #422671 is a reply to message #422666] |
Fri, 12 September 2008 14:46 |
|
Víctor Roldán Betancort schrieb:
> Hi,
>
> I'm trying to cache transactions for resources: one resource, one
> transaction. But if this resource is to be loaded in different
> ResourceSets, they will be loaded in under different transactions.
>
> Is it possible to share the transaction among different ResourceSets?
No, the relation between ResourceSet and transaction is one-to-many
(formerly even one-to-one). But even now when you have multiple
CDOTransactions associated with a single ResourceSet all these
CDOTranactions are integral part of an enclosing CDOXATransaction and
you can *not* commit/rollback one of the contained CDOTransactions
without all the others. (Simon will want to add that this is
configurable by the user, see
org.eclipse.emf.cdo.CDOXATransaction.setAllowRequestFromTran sactionEnabled(boolean),
but I strongly recommend not to change the default value!)
>
> The CDOSession.attach() method is private ...
So don't use it ;-)
Cheers
/Eike
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] Could a ResourceSet share the same CDOView? [message #422672 is a reply to message #422671] |
Fri, 12 September 2008 14:48 |
|
Eike Stepper schrieb:
> Víctor Roldán Betancort schrieb:
>> Hi,
>>
>> I'm trying to cache transactions for resources: one resource, one
>> transaction. But if this resource is to be loaded in different
>> ResourceSets, they will be loaded in under different transactions.
>>
>> Is it possible to share the transaction among different ResourceSets?
> No, the relation between ResourceSet and transaction is one-to-many
> (formerly even one-to-one). But even now when you have multiple
> CDOTransactions associated with a single ResourceSet all these
> CDOTranactions are integral part of an enclosing CDOXATransaction and
> you can *not* commit/rollback one of the contained CDOTransactions
> without all the others. (Simon will want to add that this is
> configurable by the user, see
> org.eclipse.emf.cdo.CDOXATransaction.setAllowRequestFromTran sactionEnabled(boolean),
> but I strongly recommend not to change the default value!)
Thinking once more about setAllowRequestFromTransactionEnabled() I have
to correct my previous statement. With this property you can *not*
commit/rollback one of the contained CDOTransactions without all the
others. You can only configure whether an attempt to do so should throw
an exception or delegate to the enclosing CDOXATransaction (which would
commit *all* contained CDOTransactions).
>
>>
>> The CDOSession.attach() method is private ...
> So don't use it ;-)
>
> Cheers
> /Eike
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Powered by
FUDForum. Page generated in 0.04292 seconds