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

Ask Your Question

GigaSpace.count() in LRU space


when the method GigaSpace.count(SQLQuery) is invoked in a LRU space with HibernateSpaceDataSource, it counts only matching items already in space memory, but it does not attempt to load items to be counted from the underlying database. The method GIgaSpace.readMultiple(SQLQuery) works as expected, it loads data into the space from the underlying database.

The method GigaSpace.count(SQLQuery, CountModifiers) allows to specify additional modifiers. One of the modifiers is MEMORY_ONLY which suggests that if this modifier is not used, the method count() should search not only in memory of a LRU space, but also in the underlying database. I have also tried to invoke the method GigaSpace.count() with CountModifiers.NONE, but it still counts only objects which are already in memory, without attempting to access the underlying database.

Do you agree that this is a bug? If this is not a bug, what sense does it make to have a modifier CountModifier.MEMORY_ONLY if count is always memory only?

asked 2017-02-03 02:18:20 -0500

Alexey Serdyuk gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

Hi Alexey, We understand your expectation, and indeed in count we will not go to DB due to performance considerations, the modifier of memory only search was added to other operations, as take and read and was mistakenly added here as well,Anyhow in order to implement a counter that will take into account db entries , you can build your own count aggregator, see more at: http://docs.gigaspaces.com/xap120/agg... please raise a case to discuss further your topology and solutions, and please note that we offer memory extend solution that will preform better than LRU with DB: http://docs.gigaspaces.com/xap120adm/...

Regards, Ester.

answered 2017-02-06 06:28:51 -0500

Ester gravatar image
edit flag offensive delete link more

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: 2017-02-03 02:18:20 -0500

Seen: 1,732 times

Last updated: Feb 06 '17