GlobalAdmin.DeleteDatabase Exception

61 views
Skip to first unread message

Kijana Woodard

unread,
May 19, 2016, 6:51:05 PM5/19/16
to rav...@googlegroups.com
35105

Calling store.DatabaseCommands.GlobalAdmin.DeleteDatabase throws an an aggregate exception that can't be caught, but the database does, in fact, get deleted.

Just My Code enabled.

Oren Eini (Ayende Rahien)

unread,
May 20, 2016, 8:49:13 AM5/20/16
to ravendb
It this thrown _outside_ of the Delete method, or just in the debugger?
Can you open an issue with the full stack trace?

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" 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/d/optout.

Kijana Woodard

unread,
May 20, 2016, 8:53:13 AM5/20/16
to rav...@googlegroups.com
I'll try to get that later today.
One thing to note, this is running in a console application.

From: Oren Eini (Ayende Rahien)
Sent: ‎5/‎20/‎2016 7:49 AM
To: ravendb
Subject: Re: [RavenDB] GlobalAdmin.DeleteDatabase Exception

Kijana Woodard

unread,
May 25, 2016, 10:48:08 AM5/25/16
to rav...@googlegroups.com
The db I'm deleting is called SubscriptionsTest. It's as if it deletes the db successfully and then tries to communicate with the db again.

The top level is an Aggregate exception that doesn't say much of interest.

Inner exception is: "Could not find a resource named: SubscriptionsTest"
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<CheckForErrorsAndReturnCachedResultIfAnyAsync>d__41.MoveNext() in C:\Builds\RavenDB-3.5-Unstable\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 486
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<>c__DisplayClass36_0.<<SendRequestInternal>b__0>d.MoveNext() in C:\Builds\RavenDB-3.5-Unstable\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 266
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<RunWithAuthRetry>d__38`1.MoveNext() in C:\Builds\RavenDB-3.5-Unstable\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 310
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<ReadResponseJsonAsync>d__35.MoveNext() in C:\Builds\RavenDB-3.5-Unstable\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 219
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Client.Document.Subscription`1.<CloseSubscription>d__67.MoveNext() in C:\Builds\RavenDB-3.5-Unstable\Raven.Client.Lightweight\Document\Subscription.cs:line 603

Maxim Buryak

unread,
May 25, 2016, 1:41:15 PM5/25/16
to rav...@googlegroups.com
I'm not sure that this exact scenario is a bug (except the undetailed message).. the subscription object (that is returned by teh Open function) should be disposed.




Best Regards,

Hibernating Rhinos Ltd  cid:image001.png@01CF95E2.8ED1B7D0

Maxim Buryak l Core Team Developer Mobile:+972-54-217-7751

RavenDB paving the way to "Data Made Simplehttp://ravendb.net/  


ar...@ayende.com

unread,
May 27, 2016, 4:53:54 AM5/27/16
to RavenDB - 2nd generation document database
The reason that it thew was that you removed the corresponding database before the actual disposal of the subscription object. The document store attempted to close all the active subscriptions when it was disposed (https://github.com/ayende/ravendb/blob/v3.5/Raven.Client.Lightweight/Document/DocumentStore.cs#L277) however that resulted in error because the database no longer existed.

If you want to delete the relevant database you need dispose this object first:
https://github.com/kijanawoodard/Talk-RavenConf-2016/blob/master/demo/RavenDataSubscriptions/Program.cs#L47

Then under the hood the subscription will be closed and won't attempt to do it on the disposal of the document store, when the db is already deleted.

Kijana Woodard

unread,
May 27, 2016, 10:39:37 AM5/27/16
to rav...@googlegroups.com
Ah. It is a bit awkward. I did in fact think of that scenario, so I called release and delete on the subscription.


I didn't think to also call dispose.
Can confirm that calling "orders.Dispose();" fixes the issue.

At first glance, it seems that it would make sense to call "Release" on the open subscription which would release and dispose. One without the other seems non-intuitive.

Thanks!

Arkadiusz Palinski

unread,
May 30, 2016, 2:48:28 AM5/30/16
to rav...@googlegroups.com
Release and Delete methods are rather meant to manage the subscriptions on the server side, not the client instances. The problem happened because the database had been deleted before the client side objects requiring disposal were properly released.

Regarding Release call on subscription open - for that purpose we have opening strategies. The subscription is released first if SubscriptionOpeningStrategy.TakeOver is specified. More about strategies can be found here:
https://ravendb.net/docs/article-page/3.0/csharp/client-api/data-subscriptions/how-to-open-data-subscription

--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/I7L9HGAGh3k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Arek Palinski
Reply all
Reply to author
Forward
0 new messages