Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDO Duplicate ID problem with multiple getResource() calls in the same transaction
[CDO] CDO Duplicate ID problem with multiple getResource() calls in the same transaction [message #424321] Wed, 22 October 2008 21:21 Go to next message
Stephen McCants is currently offline Stephen McCantsFriend
Messages: 92
Registered: July 2009
Member
Hello,

Sorry to keep bringing up problems, but I'm hope this is the last one for a while. I've run into a
problem were sometimes loading a resource twice from the same CDOTransaction results into a
duplicate ID exception. I traced down into the CDO code and it looked like it wasn't finding the
resource (that was created with a getOrCreateResource() call) and therefore it was trying to create
it again, which resulted in a duplicate ID.

The different calls were in different functions, and I decided to cache the resource after getting
it the first time. That cleared up the problem. However, it seems like you should be able to call
getResource() multiple times in the same transaction on the same resource.

Thanks again!

--Stephen McCants
Re: [CDO] CDO Duplicate ID problem with multiple getResource() calls in the same transaction [message #424322 is a reply to message #424321] Wed, 22 October 2008 22:27 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
Hi Stephen,

this is a known issue :

248915: Resources fetched using CDOViewImpl.getResource(CDOID) not added
to ResourceSet
https://bugs.eclipse.org/bugs/show_bug.cgi?id=248915

This bugs also state that a duplicate ID could occured.

It is fixed with the ResourceFolder effort.

It is only available in HEAD.


Stephen McCants wrote:
> Hello,
>
> Sorry to keep bringing up problems, but I'm hope this is the last one
> for a while. I've run into a problem were sometimes loading a resource
> twice from the same CDOTransaction results into a duplicate ID
> exception. I traced down into the CDO code and it looked like it wasn't
> finding the resource (that was created with a getOrCreateResource()
> call) and therefore it was trying to create it again, which resulted in
> a duplicate ID.
>
> The different calls were in different functions, and I decided to cache
> the resource after getting it the first time. That cleared up the
> problem. However, it seems like you should be able to call
> getResource() multiple times in the same transaction on the same resource.
>
> Thanks again!
>
> --Stephen McCants
Re: [CDO] CDO Duplicate ID problem with multiple getResource() calls in the same transaction [message #424323 is a reply to message #424322] Wed, 22 October 2008 23:03 Go to previous message
Stephen McCants is currently offline Stephen McCantsFriend
Messages: 92
Registered: July 2009
Member
Good to know. Thanks!
--Stephen

Simon McDuff wrote:
>
> Hi Stephen,
>
> this is a known issue :
>
> 248915: Resources fetched using CDOViewImpl.getResource(CDOID) not added
> to ResourceSet
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=248915
>
> This bugs also state that a duplicate ID could occured.
>
> It is fixed with the ResourceFolder effort.
>
> It is only available in HEAD.
>
>

>
Previous Topic:[CDO] Exceptions thrown on transaction.commit
Next Topic:Live Validation: Undo, if constraint is violated
Goto Forum:
  


Current Time: Fri Apr 26 16:13:28 GMT 2024

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

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

Back to the top