Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Could a ResourceSet share the same CDOView?
[CDO] Could a ResourceSet share the same CDOView? [message #422666] Fri, 12 September 2008 11:25 Go to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
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?

The CDOSession.attach() method is private ...
Re: [CDO] Could a ResourceSet share the same CDOView? [message #422671 is a reply to message #422666] Fri, 12 September 2008 14:46 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
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


Re: [CDO] Could a ResourceSet share the same CDOView? [message #422672 is a reply to message #422671] Fri, 12 September 2008 14:48 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
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


Re: [CDO] Could a ResourceSet share the same CDOView? [message #422675 is a reply to message #422671] Fri, 12 September 2008 15:01 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
Like Eike said, you could have for one Resourceset many transactions that do
not belon to the same repository.

In the following:
transA1-REPOA
transA2-REPOA
transB1-REPOB1
transB2-REPOB1

You could have for One resourceset:
- transA1 and transB1
You cannot have
- transA1 and transA2

Also, by default the CDOXATransaction isn't turned on.
To activate it true a CDOVIewSet you need to

- CDOUtil.createXATransaction
- xaTransaction.add(CDOUtil.prepareResourceSet(resourceset)); or
- xaTransaction.add(cdoView.getViewSet());

By default, CDOXATransactionisn't activated until you activate it. Should it
be always activated ?

About CDOXATransaction.setAllowRequestFromTransactionEnabled().
I strongly recommend to not change it as well. In some cases, it is not
possible to commit without it. (cyclic graph between both of them).

Simon

About
"Eike Stepper" <stepper@esc-net.de> a
Previous Topic:Ecore ID property
Next Topic:Re: [emf-dev] Re: Problem loading editor with many ECore Model
Goto Forum:
  


Current Time: Fri Apr 19 02:31:27 GMT 2024

Powered by FUDForum. Page generated in 0.02050 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top