Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Deleting a resource from the database
[CDO] Deleting a resource from the database [message #729502] Mon, 26 September 2011 07:01 Go to next message
Missing name Missing name is currently offline Missing name Missing name
Messages: 17
Registered: September 2011
Junior Member
I have deleted a CDOResource using

EObject[] roots = resource.getContents().toArray(new EObject[resource.getContents().size()]);
		for (int i = 0; i < roots.length; i++) {
			EcoreUtil.delete(roots[i], true);
		}
		try {
			resource.delete(null);
		} catch (IOException e1) {
			e1.printStackTrace();
		}


The resource is deleted as it cannot be accessed from any CDO client, but the objects still are in the database, which is very unpleasing since the resource contained ~70.000 elements.

Is there any other way to delete a resource that involves database object removal?

Thanks in advance.
Re: [CDO] Deleting a resource from the database [message #729512 is a reply to message #729502] Mon, 26 September 2011 07:14 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Hmm, this could be a bug, which CDO version are you on?

gr. Martin

On 09/26/2011 01:01 PM, inbasswetrust wrote:
> I have deleted a CDOResource using
>
>
> EObject[] roots = resource.getContents().toArray(new EObject[resource.getContents().size()]);
> for (int i = 0; i < roots.length; i++) {
> EcoreUtil.delete(roots[i], true);
> }
> try {
> resource.delete(null);
> } catch (IOException e1) {
> e1.printStackTrace();
> }
>
>
> The resource is deleted as it cannot be accessed from any CDO client, but the objects still are in the database, which
> is very unpleasing since the resource contained ~70.000 elements.
>
> Is there any other way to delete a resource that involves database object removal?
>
> Thanks in advance.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Deleting a resource from the database [message #729514 is a reply to message #729512] Mon, 26 September 2011 07:35 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing name
Messages: 17
Registered: September 2011
Junior Member
CDO Version 4.0. Thanks.
Re: [CDO] Deleting a resource from the database [message #729708 is a reply to message #729514] Mon, 26 September 2011 15:45 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Seems to be a bug then, the resource's content is mapped with delete-orphan, so I would expect the contents to be deleted.

Can you enter a bugzilla for this?

gr. Martin

On 09/26/2011 01:35 PM, inbasswetrust wrote:
> CDO Version 4.0. Thanks.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Re: [CDO] Duplicate annotation using CDO Hibernate
Next Topic:[CDO] Method cdoSession.openAudit()
Goto Forum:
  


Current Time: Wed Aug 20 12:47:52 EDT 2014

Powered by FUDForum. Page generated in 0.11357 seconds