Re: [RavenDB] Changes API issue

122 views
Skip to first unread message

Oren Eini (Ayende Rahien)

unread,
Apr 11, 2013, 2:01:32 PM4/11/13
to rav...@googlegroups.com
What do you expect to happen if the db isn't there?

On Thursday, April 11, 2013, Dan Goulet wrote:
Hi everyone.

I've got a problem with the changes api, and I'm not certain whether it's me or a bug.

I have something similar to this:

_changes = _store.Changes(DbName);
_changes.ForAllDocuments().Subscribe(OnChange);

In OnChange I'm checking to see if the change type is put or delete.
Now, if RavenDB is running, everything works so slick I couldn't begin to say how simple this is.
If for any reason RavenDB isn't running then bad things happen. I've just started learning RX so be gentle.

An exception is thrown from ObservableLineStream.Start in the Raven.Client.Lightweight project (I got the source and had a quick read, version 2.0.3.13)
The RunAsync().ContinueWith(task => usually works fine until the database isn't available, and in that case task.Result throws an AggregateException which I cannot catch in my consuming code (I'm guessing this i because it's in a different thread or...).
The second ContinueWith is never fired in this case.

My goals are fairly simple, this change api code will be in a web application, if anything ever changes in the RavenDB then update the memory cache in an application.

Any ideas are greatly appreciated.


Thanks,
Dan

--
You received this message because you are subscribed to the Google Groups "ravendb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dan Goulet

unread,
Apr 11, 2013, 2:16:31 PM4/11/13
to rav...@googlegroups.com
Hi Oren,

I'm happy that the client code throws an exception, but I'm unable to catch it and it crashes the program. A simple try catch on my end of the client doesn't do what I'd expect.
I could be missing something with RX or...

I'd like to be able to catch the exception, or have it disappear all together, just allowing the changes api to fire the ConnectionStatusChanged event letting me know that the connection status has changed. 
It appears that the changes api continues trying to connect to a database that is down, this is good as I'd want it to do this although that AggregateException or others continue to crop up and I cannot catch them.


Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Dan Goulet

unread,
Apr 11, 2013, 3:26:39 PM4/11/13
to rav...@googlegroups.com
Hi Oren,

Looks like I figured it out. Damn, I feel like an idiot.

It was the Enable Just My Code setting in VS.NET 2010, under Debugging/General.
I had it enabled and after disabling it everything worked exactly as I'd expect.

Here's the article I read which led me to the right solution:


Thanks,
Dan

Oren Eini (Ayende Rahien)

unread,
Apr 12, 2013, 1:15:06 AM4/12/13
to ravendb
Okay, great




Thanks,
Dan

--
You received this message because you are subscribed to the Google Groups "ravendb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages