Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

com.j_spaces.core.DetailedUnusableEntryException

I have a POJO that has a field "transient String mUID", and is written to space using IJSpace.write(). However when I later read the POJO, and call its getUID() method, it returns null. I am trying to use the mUID in a call to IJSpace.update(), which requires UID. The following exception is thrown at runtime:

com.j_spaces.core.DetailedUnusableEntryException: Update: UID must be supplied for updated entry.

Here's the code:

ClassA result = ijSpace.read(template, transaction, WAIT_TIME);

ClassA updatedA = new ClassA(m1, null, result.__getEntryUID()); Object obj = ijSpace.update(updatedA, transaction,Lease.FOREVER, WAIT_TIME, UpdateModifiers.UPDATE_ONLY);

This used to work until I changed ClassA to NOT implement Entry interface.

Edited by: s m on Feb 19, 2008 12:46 PM

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=1974]{quote}

asked 2008-02-19 11:43:18 -0500

wasefmasood gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

The _setEntryUid() and _getEntryUid() and the other __XXX methods relevant only for Entry bases classes and not for POJOs.
You should use the relevant annotations.
Shay

answered 2008-02-19 12:38:38 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

I added a property "mappingUID", and a ClassA.gs.xml file (in the same package as ClassA) as follows: <gigaspaces-mapping> <class name="mypkg.ClassA" persist="false" replicate="true" fifo="false" >="" <property="" name="field1" index="none"/> <property name="field2" index="none"/> <id name="mappingUID" auto-generate="true"/> </class> </gigaspaces-mapping>

However, after I read the instance from space and call getMappingUID(), its still null.

Also, Can you tell me whether the following lines of code need to change for the POJO, and if so how:

ClassA result = ijSpace.read(template, transaction, WAIT_TIME); ClassA updatedA = new ClassA(m1, null, result.getMappingUID()); Object obj = ijSpace.update(updatedA, transaction,Lease.FOREVER, WAIT_TIME, UpdateModifiers.UPDATE_ONLY);

Thanks.

Edited by: s m on Feb 19, 2008 4:51 PM

Edited by: s m on Feb 19, 2008 4:52 PM

wasefmasood gravatar imagewasefmasood ( 2008-02-19 15:02:48 -0500 )edit

I tried including the meta-data in an xml file, but no luck(see previous post for details). I cant include annotations, as the class will be a part of web service. any ideas on questions in previous post? Also, is there an example on calling IJSpace.update() using POJOs? I did not find any on the wiki.

wasefmasood gravatar imagewasefmasood ( 2008-02-19 18:57:26 -0500 )edit

see: http://www.gigaspaces.com/wiki/displa... See the POJO Based Class section. Shay

shay hassidim gravatar imageshay hassidim ( 2008-02-20 10:34:03 -0500 )edit

1) Does the following element in ClassA.gs.xml correspond correctly to the @SpaceVersion annotation:

<version name="versionId"/>

2) With 6.0.3, is it correct to assume that ClassA.gs.xml can be in the same package as ClassA, and its not required to be in config/mapping directory?

wasefmasood gravatar imagewasefmasood ( 2008-02-20 16:11:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2008-02-19 11:43:18 -0500

Seen: 87 times

Last updated: Feb 19 '08