Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Eclipse Link tenant property lost on cascading delete
Eclipse Link tenant property lost on cascading delete [message #1002619] Sat, 19 January 2013 00:26 Go to next message
Donat Mueller is currently offline Donat MuellerFriend
Messages: 11
Registered: January 2013
Location: switzerland
Junior Member
Hi,

I have set up a multy tenancy orm mapping.
Inserting works fine but when I try to delete a record that was read before I get an exception No value was provided for the session property [eclipselink.tenant-id].
I did not model the tenantid in my pojo's. So the translationRow does not contain tenancy information:

ArrayRecord(
model_ValueContainer.dbId => 1
model_ValueContainer.TENANT_ID => null
model_ValueContainer.externalId => 1
model_ValueContainer.name => Realestate
model_ValueContainer.state => 0
model_ValueContainer.template => null
model_ValueContainer.type => Domain)

ParameterExpression on line 265 gets null for the field: eclipselink.tenant-id
value = session.getProperty(getField().getName());

I have set the properties on creation of the entity manager.
		Long tenant = getTenantsForUser("testuser").get(0);
		Map<String, Object> emProperties = new HashMap<String, Object>();		 
		emProperties.put("eclipselink.tenant-id", tenant);
		EntityManager entityManager = emf.createEntityManager(emProperties);


Should I configure sessions.xml to get this to work ?

Any ideas/help appreciated
Donat
  • Attachment: model.png
    (Size: 29.08KB, Downloaded 57 times)
Re: Eclipse Link tenant property lost on cascading delete [message #1002750 is a reply to message #1002619] Sat, 19 January 2013 09:36 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5340
Registered: July 2009
Senior Member
Hi Donat,
I don't really know the answer to this one. I think it is better to ask this on the eclipselink forum/newsgroup.

gr. Martin

On 01/19/2013 01:26 AM, Donat Mueller wrote:
> Hi,
>
> I have set up a multy tenancy orm mapping.
> Inserting works fine but when I try to delete a record that was read before I get an exception No value was provided for the session property [eclipselink.tenant-id].
> I did not model the tenantid in my pojo's. So the translationRow does not contain tenancy information:
>
> ArrayRecord(
> model_ValueContainer.dbId => 1
> model_ValueContainer.TENANT_ID => null
> model_ValueContainer.externalId => 1
> model_ValueContainer.name => Realestate
> model_ValueContainer.state => 0
> model_ValueContainer.template => null
> model_ValueContainer.type => Domain)
>
> ParameterExpression on line 265 gets null for the field: eclipselink.tenant-id
> value = session.getProperty(getField().getName());
>
> I have set the properties on creation of the entity manager.
>
> Long tenant = getTenantsForUser("testuser").get(0);
> Map<String, Object> emProperties = new HashMap<String, Object>();
> emProperties.put("eclipselink.tenant-id", tenant);
> EntityManager entityManager = emf.createEntityManager(emProperties);
>
>
> Should I configure sessions.xml to get this to work ?
>
> Any ideas/help appreciated
> Donat
>


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:[EMFStore] Is it somehow possible to use EMFStore for metamodels?
Next Topic:[Texo] Errors while generating model code
Goto Forum:
  


Current Time: Sun Dec 21 17:26:07 GMT 2014

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

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