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

Ask Your Question
0

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 gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

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 ?

Shay

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

shay hassidim gravatar image
edit flag offensive delete link more

Comments

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 gravatar imagekaarelk ( 2008-08-19 06:32:41 -0500 )edit
0

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 gravatar image
edit flag offensive delete link more

Comments

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 gravatar imagekaarelk ( 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

Stats

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

Seen: 60 times

Last updated: Aug 21 '08