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

Ask Your Question

Accessing DB sequence from GigaSpaces

I need to allocate sequence ID when I'm creating an object in space but not yet persisting it in DB. Additionally I need sequence caching to be switched on (so application can continue for some time without DB). Does GigaSpaces provide a solution to match my UC?

If not is there a good way to just access DB sequnce from GigaSpaces? Only way I found was to do the query on db connection directly.

GUID and UUID solutions are not acceptable as this is legacy system being ported to be using GigaSpaces.

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

asked 2008-08-19 01:50:46 -0500

kaarelk's avatar

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

jaissefsfex's avatar
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

You can implement sequencing with GigaSpaces using a singleton space entry.
When incrementing the value within the singleton object you should perform the update using a transaction.
Can you explain why you can't use UUID generator?
Are you using sequencing to generate unique space object id ?


answered 2008-08-19 05:03:30 -0500

shay hassidim's avatar
edit flag offensive delete link more


When the answer is no then just say so.

GUID/UUID solution requires changing big part in legacy system that otherwise wouldn't be affected when porting to GigaSpaces (as I already hinted).

Allocated ID has to be unique in entire system (space, DB, client etc).

kaarelk's avatar kaarelk  ( 2008-08-19 06:32:41 -0500 )edit

We added a space filter that is called before write to the space. If the id value is null, then get the sequence value and set it..

Under heavy write conditions, getting the sequence value will be your bottleneck. If your app is write intensive, you should look at migrating to a UUID generation based solution

answered 2008-08-21 12:15:38 -0500

davebyrne's avatar
edit flag offensive delete link more


Yeah, we aware of the performance issues and probably will have solution that queries sequence values with big steps but gives out IDs with increment of 1 (caching sequence ranges).

kaarelk's avatar kaarelk  ( 2008-08-22 08:52:15 -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


Asked: 2008-08-19 01:50:46 -0500

Seen: 79 times

Last updated: Aug 21 '08