Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361501

Summary: CDOResourceSetImpl.createResource(URI) should create the resource on the server site
Product: [Modeling] EMF Reporter: Martin Fluegge <martin.fluegge>
Component: cdo.coreAssignee: Project Inbox <emf.cdo-inbox>
Status: CLOSED WORKSFORME QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: vaisegid
Version: 4.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows Server 2003   
Whiteboard:

Description Martin Fluegge CLA 2011-10-20 02:56:51 EDT
Callinng ResourceSet.getResource(URI, true) will lead to an exception when working with CDO resources (if the resource down not yet exist on the server site). The reason for this is that the CDOResourceFactoryImpl currently only creates a local instance of the resource on the client site but no counterpart on the server. Thus, loading the resource fails because it not yet persisted in the store. To have more compliance to existing code code and to make it easier for users to port their applications to CDO we should also create the resource on the server site during the creation process.
Comment 1 Egidijus Vaisnora CLA 2011-10-20 04:05:54 EDT
It looks like that with this feature we will start to create user data on server without making transaction commit. Doesn't look clear client-server concept. I could rollback transaction, but changes are exposed remotely to others.

Another concern, we will need to expect that it could be a conflict on server, thus each caller of "createResource" will need to expect "ConcurrentModificationException".

More ever, even if you create resource on server silently, you are not sure that someone will remove it until you commit transaction. Thus we still have handle situation when Resource exist only locally and is not available on server. What then is the benefit of creating resource in advance?
Comment 2 Eike Stepper CLA 2011-10-20 05:00:04 EDT
Martin, there must be a misunderstanding again. ResourceSet.createResource() behaves exactly as it's supposed to. It creates the new resource in memory and the next commit() will bring it to the server.
Comment 3 Eike Stepper CLA 2012-09-21 07:17:59 EDT
Closing.