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

Ask Your Question
0

Blocking read

How do I implement a blocking read? Should I just set a large timeout in this call gigaspace.read(templates, timeout)?

Do you have a constant defined somewhere? Or can I use Lease.FOREVER?

Thx

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

asked 2010-08-11 16:10:52 -0500

nitinmalik gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

In general , blocking read means having timeout > 0. You can use Lease.FOREVER as the timeout. This means your client thread might never return.
Please note blocking read is not supported when using a template where its routing field is null with a remote partitioned space.

You might want to take a look on the asyncRead operation.

Can you explain what's the use case? You you want to use blocking read?

Shay

answered 2010-08-11 21:55:43 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

On startup, our service layer executes a couple of DB queries that take ~20 minutes to execute. This causes delays in our startup time - esp if we have to bounce intraday.

We have moved these calls into a PU and the service now downloads this data from the space. Incase our PU is down (a rare occurrence), we want to block the SL from initializing until its available.

nitinmalik gravatar imagenitinmalik ( 2010-08-12 08:38:34 -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: 2010-08-11 16:10:52 -0500

Seen: 18 times

Last updated: Aug 11 '10