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

Ask Your Question
0

Mirror service and generated ID

Does Gigaspaces not like auto generated ID column?

I have a method in a persisted SpaceClass that has the following annotation:

@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getId() {
    return id;
}

I can see from the console that mirror service got the entry. But it doesn't seem to do anything with or give any error. It just doesn't appear in the database. If I change the id to an assigned value, it works fine.

Thanks,

Simon

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

asked 2008-06-26 19:26:16 -0600

noiseba gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

When a space configured with ExternalDataSource or using the Mirror Service you should generate the Space object Id yourself.
This means you should annotate the IF field using:
@SpaceId (autogenerate=false)
and place a unique value into the field prior writing the object into the space.

See more:
http://www.gigaspaces.com/wiki/display/OLH/JavaSpacesPOJO

Shay

answered 2008-06-26 19:42:12 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Thanks Shay.

I think I read it before but totally forgot about it.

noiseba gravatar imagenoiseba ( 2008-06-27 01:04:09 -0600 )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-06-26 19:26:16 -0600

Seen: 25 times

Last updated: Jun 26 '08