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

Ask Your Question

Creating GigaSpace per proxy in code


I have question. I have PU with number-of-instances="4" number-of-backups="1". I need to invoke takeMultiple(someTemplate) operation on whole PU. I do this by preparing GigaSpace object like this:

public GigaSpace getProxyGigaSpace() {
        UrlSpaceConfigurer urlSpaceConfigurer = new UrlSpaceConfigurer("jini://*/*/Space");
        urlSpaceConfigurer.userDetails("username", "password");
        return new GigaSpaceConfigurer(urlSpaceConfigurer).gigaSpace();

Last time I faced one problem. I invoked take method on this proxyGigaSpace and it returned 0 object but should return 1 object (because it existed in space). Is it possible that getProxyGigaSpace() method return reference to GigaSpace object which not refers to entire cluster? (eg. is connected to part of instances)?

Are there any differences between creating space like this and creating space in pu.xml :

<os-core:space id="space" url="jini://*/*/Space" lookup-timeout="30000">
            <os-core:security username="username" password="password"/>
<os-core:giga-space clustered="true" id="spacePerProxy" space="space" tx-manager="transactionManager"/>

Thanks in advance.

asked 2014-08-01 08:22:09 -0500

Kamil K gravatar image

updated 2014-08-01 09:08:02 -0500

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

why won't you use GigaSpace.takeByIds instead in this case? It will work much better than takeMultiple.

answered 2014-08-04 14:15:44 -0500

shay hassidim gravatar image
edit flag offensive delete link more


Because we have custom key. And takeById with custom(complex) key is not working. Our key is made of two values because we have own versioning mechanism. So we have to use query with in clause.

rafik gravatar imagerafik ( 2014-08-05 06:26:56 -0500 )edit

By default when using "jini:////Space" URL you will have a clustered proxy.

Any chance you have a primitive field within your object that prevents the takeMultiple to find matching objects?

Any chance the template you use with the takeMultiple have the routing field set to some value? This will rout the takeMultiple call into a specific partition and not to the entire cluster. Can you post your space class please? How to you call the take multiple? What's the max-objects parameter value?


answered 2014-08-01 09:58:21 -0500

shay hassidim gravatar image
edit flag offensive delete link more


So the template that we use to query data is

 `String spaceQuery = getSpaceQuery(Collections.singletonList(listOfIds)); // creating in clause in('list of ids')

  SQLQuery<OurClass> query = new SQLQuery<OurClass>(OurClass.class, spaceQuery);
  OurClass[] tab = gigaSpacePerProxy.takeMultiple(query);`

And OurClass do not contain primitives.

rafik gravatar imagerafik ( 2014-08-04 02:22:41 -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



Asked: 2014-08-01 08:22:09 -0500

Seen: 524 times

Last updated: Aug 04 '14