Membase Exception handling
Thu, 01/13/2011 - 23:39
Hi all,
Challenge 1:
Is there a way to genrate a exception if the data/object is not stored in the database. When a user signs up on my website. His object is created and this object gets stored in the dB.
I need to check if the user sign up has been done successfully !!!!
(Using Silverlight & C#)
Challenge 2:
If there 50 users then there will be 50 objects in the db. How do I fetch object based on one property of the user. Like "get all the users whose age is > 24".
I am talking about something like a SQL query.
Love & Peace
Sushant
Hi Sushant, happy to help here.
For the first challenge, if you make a request for the item and it does not exist in the database, Membase will return a "NULL". There is also an API call in the Enyim client called "TryGet" which will return 0 instead of NULL if the item doesn't exist for cases where you need a non-nullable data type like an integer or boolean.
For the second, the ability to query and index is a feature that we are currently working on for an upcoming release. It will be built upon our TAP interface which you could use today to achieve the same results. Take a look at this wiki page: http://wiki.membase.org/display/membase/TAP+Protocol as well as this blog entry (http://blog.membase.com/libmembase-c-interface-to-membase). That will let you stream all the data out of the Membase server (either from an external server or locally on the same system) and then you can write some logic to return only the items "whose age is > 24".
Make sense? We'll be doing essentially the same thing with a more robust and user-friendly interface on it.
Perry
Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!