|
Search Solutions & Best Practices
Browse Solutions & Best Practices
|
OverviewWhen writing objects into the space, you may need to generate a global unique ID for your space objects. The ID will be used later to fetch the object based on its ID via the readById/readByIds methods, or associate it with another object by placing the object ID as a field value within another object. GigaSpaces generates a unique global ID when writing new objects using its built-in internal ID generator utility used when enabling the auto-generate ID property. Still, you may want to have your own custom global unique ID generator.
The following example includes a custom global unique ID generator PU and a client side utility. The Unique Global ID Generator features the following:
Using the ID GeneratorTo use the ID Generator you should: SpaceBasedIdGenerator idGenerator;
Integer myNextID = idGenerator.generateId();
The ID Generator ComponentsThe following should be used to enable the ID Generator: |
Additional resources: XAP Application Server | XAP Data Grid | XAP for Cloud Computing | XAP J2EE Support

