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

Ask Your Question
0

Persistence: change field with SpacePersist on update

Hi,

We are using XAP 9.7 and Mirror with hibernate for persistence. We noticed that

  1. An object with SpacePersit set to true - when written to space is persisted in DB as expected
  2. An object with SpacePersit set to false- when written to space is not persisted in DB as expected
  3. The object from 2 is read back, the SpacePersist field is toggled to true and written back to space (updated using WriteModifiers.UPDATE_ONLY) - is not persisted

Can someone clarify the behaviour on #3? How can the object be persisted on an update?

Thanks

asked 2015-01-05 14:57:10 -0500

myth's avatar

updated 2015-01-05 14:57:40 -0500

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

a transient space object cannot be modified to be a persistent object after it was written to the space. You will have to write a new (persistent) object with a different ID and remove the old transient version. Another option would be to delete the transient and write it again as persistent with the same ID - never tried it but might work.

answered 2015-01-05 15:04:10 -0500

shay hassidim's avatar
edit flag offensive delete link more

Comments

Thanks.

That is a workaround we were considering - but the problem with that is all the listeners will get notified of object deletion and then addition - which is unnecessary and in some cases incorrect. All that is required is an update event!

myth's avatar myth  ( 2015-01-05 15:08:32 -0500 )edit

For now you will have to add an additional boolean field into the space object that will indicate its an object that need to be ignored.You can add it to the template/query used by the polling container to filter it as part of the polling activity.-------- Original message --------From: forum@ask.gigaspaces.orgDate:01/05/2015 4:06 PM (GMT-05:00)

shay hassidim's avatar shay hassidim  ( 2015-01-06 16:55:25 -0500 )edit
0

For now you will have to add an additional boolean field into the space object that will indicate its an object that need to be ignored.

You can add it to the template/query used by the polling container to filter it as part of the polling activity.

answered 2015-01-06 09:14:49 -0500

shay hassidim's avatar
edit flag offensive delete link more

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: 2015-01-05 14:57:10 -0500

Seen: 723 times

Last updated: Jan 06 '15