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

Ask Your Question
0

what does write() do exactly

Hi there,

I have a gigaspace setup with a bunch of data providers, so that when a client reads a key that does not exist in the space, one of the providers will go to external data source to retrieve the data before the space passes the data back to the client.

Now I want to write to the space directly from client.I thought this would bypass the data providers. But that is not what's happening in my setup. I always see the providers get invoked.

I knew this because that the key is formatted in a special way so the data provider knows how to parse it and request the data for the key from external data sources. But when I tried write() with a dummy key that could not be parsed by the data provider, I got exceptions from my data provider saying the key is invalid.

So how does the space handle write() exactly? does it always trigger data provider?

Thanks much in advance Chen

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

asked 2010-02-04 08:01:13 -0600

coshaw 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

Take a look here:
http://www.gigaspaces.com/wiki/display/XAP7/ExternalDataSourceAPI - this explains all the possible options.

The write operation triggers EDS.read + EDS.write. The reason for the EDS.read when write is performed is to support object versioning and ensure uniqueness - we check if there is a matching object within the database before inserting such into the space. If there is matching object within the database the write operation will be rejected.

Shay

answered 2010-02-04 09:10:03 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Thanks Shay, that explains what happened.

here goes my another question. what I wanted to do was to bypass the existing external data source setup I have but allow caching free data using the read() and write() api in the same cache. that means my client will control what data to put into the cache and read them out when needed. Do you if that is possible?

coshaw gravatar image coshaw  ( 2010-02-04 13:35:03 -0600 )edit

Take a look on the @SpaceClass (persist = false). This will allow you to specify if you want the object to be persist (via EDS) or not.

Shay

shay hassidim gravatar image shay hassidim  ( 2010-02-04 15:23:15 -0600 )edit

Worked perfectly. thanks a lot Shay!

coshaw gravatar image coshaw  ( 2010-02-04 16:34:49 -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: 2010-02-04 08:01:13 -0600

Seen: 124 times

Last updated: Feb 04 '10