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

Ask Your Question

what is the differnece between read(template) and read(sqlquery)

I am eager to know the difference between the two methods provided in reading the object(s) from gigasapces.

  1. gigaSpace.read(SQLQuery)
  2. gigaSpace.read(template)

For ex: Employee template= new Employee(); template.setFirstName("John"); Employee emp = gigaSpace.read(template);

I have the below entries from gigasapce:

Employee _Firstname Lastname_ John Smith John William John Marry

What will happen if more matching entries in the gigasapces. Which one will return what is the order?

Edited by: Gopinathan Mani on May 3, 2013 12:37 AM

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

asked 2013-05-03 00:30:57 -0500

get4gopim 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

The difference is that SQLQuery support other matching criterias that you cannot specify using a template.

For example, OR and range queries. (e.g. firstName = 'john' or firstName = 'nicole').

There is no difference in matter of order for template or query assuming both are equivalent. In order to provide high parallelism the order you get the results is not deterministic unless FIFO is used.


answered 2013-05-05 04:43:16 -0500

eitany 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: 2013-05-03 00:30:57 -0500

Seen: 130 times

Last updated: May 05 '13