ryanheath / RavenDB-NodaTime

Noda Time support for RavenDB
Other
20 stars 14 forks source link

RavenDB v4 support #18

Closed AKlaus closed 6 years ago

AKlaus commented 6 years ago

Hi Matt, thanks for the projects, it works like a charm!

Just one thing, RavenDB v4 has been out since February and they changed the interfaces, so RavenDB-NodaTime can't be configured anymore.

Would it be possible to release a new version of RavenDB-NodaTime to support RavenDB v4?

ryanheath commented 6 years ago

Hi Alex,

I’ll look into this weekend, let’s what we can do.

What do you mean with: ‘they changed the interfaces, so RavenDB-NodaTime can't be configured anymore‘

It could help if you can pinpoint what has changed.

Thanks!

// Ryan

On Thu, 17 May 2018 at 02:12, Alex Klaus notifications@github.com wrote:

Hi Matt, thanks for the projects, it works like a charm!

Just one thing, RavenDB v4 has been out since February and they changed the interfaces, so RavenDB-NodaTime can't be configured anymore.

Would it be possible to release a new version of RavenDB-NodaTime to support RavenDB v4?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mj1856/RavenDB-NodaTime/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/AAq0XkjeL48sttciNi2mBEbMnX4lrMWvks5tzMB0gaJpZM4UCOPq .

AKlaus commented 6 years ago

Thanks @ryanheath,

I didn't investigate much, but the ConfigureForNodaTime() extension method fails due to IDocumentStore interface has changed and moved to another namespace.

The quickest way to see the changes IMHO is to copy/paste the following two URLs in www.diffnow.com:

ryanheath commented 6 years ago

@AKlaus Just to let you know I am working on it. Most tests are succeeding, but quite a few are failing, mostly about using NodaTime in indexes or server side.

AKlaus commented 6 years ago

@ryanheath, would you mind creating a branch with your changes here on GitHub, so I could be of any help?

ryanheath commented 6 years ago

Yes, I will. But first we need to bring (back) some functionality into ravendb 4. Our lib is depending on it, but it was removed from ravendb 4. I hope to do/start with it this week.

ryanheath commented 6 years ago

https://github.com/ravendb/ravendb/pull/6415 is merged! Now we can proceed further.

ryanheath commented 6 years ago

See https://github.com/mj1856/RavenDB-NodaTime/tree/feature/upgrade-v40 We're almost there I think. There is still an issue with loading the bundle at server side. See https://groups.google.com/forum/#!topic/ravendb/5CpsLbz2epY Hopefully we can fix it shortly

AKlaus commented 6 years ago

Great news! It seems to be a massive work! I see that RavenDB pull requests been merged into master and should be available in the nightly build. Does it mean that if I use the nightly build and the code from feature/upgrade-v40 branch it should all be working?

ryanheath commented 6 years ago

If you only use the clientside of the lib then you can do that, yes. Serverside of the lib has still some issues.

AKlaus commented 6 years ago

I can confirm that the client-side is working great with RavenDb v4.0.5

ryanheath commented 6 years ago

Great to here!

I want to wait for v4.0.6 to release a NuGet package.

// Ryan

On Tue, 19 Jun 2018 at 08:45, Alex Klaus notifications@github.com wrote:

I can confirm that the client-side is working great with RavenDb v4.0.5

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/mj1856/RavenDB-NodaTime/issues/18#issuecomment-398292045, or mute the thread https://github.com/notifications/unsubscribe-auth/AAq0Xukt9laAE_ICNZ_F6bxDtVesKONCks5t-J30gaJpZM4UCOPq .

tobiaszuercher commented 6 years ago

i did a fork of your raven4-update branch and added a sample console exe (https://github.com/tobiaszuercher/RavenDB-NodaTime/blob/feature/upgrade-v40/src/Sample/Program.cs).

using RavenDB Server 4.0.6-patch-40047 (as mentioned in ravendb maillist https://groups.google.com/forum/#!topic/ravendb/5CpsLbz2epY) and copying NodaTime.dll, Raven.Bundles.NodaTime.dll to the server.exe i get the following index errors:

Failed to execute mapping function on people/33-A. Exception: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The best overloaded method match for 'Raven.Bundles.NodaTime.NodaTimeField.AsInstant(System.DateTime)' has some invalid arguments
   at CallSite.Target(Closure , CallSite , Type , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at Raven.Server.Documents.Indexes.Static.Generated.Index_ServerSideNodaTime_Index.<>c.<.ctor>b__0_2(Object this0)
   at System.Linq.Utilities.<>c__DisplayClass2_0`3.<CombineSelectors>b__0(TSource x)
   at System.Linq.Utilities.<>c__DisplayClass2_0`3.<CombineSelectors>b__0(TSource x)
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at Raven.Server.Documents.Indexes.Static.TimeCountingEnumerable.Enumerator.MoveNext() in C:\Builds\RavenDB-4.0-Patch\src\Raven.Server\Documents\Indexes\Static\TimeCountingEnumerable.cs:line 41
   at Raven.Server.Documents.Indexes.MapIndexBase`2.HandleMap(LazyStringValue lowerId, IEnumerable mapResults, IndexWriteOperation writer, TransactionOperationContext indexContext, IndexingStatsScope stats) in C:\Builds\RavenDB-4.0-Patch\src\Raven.Server\Documents\Indexes\MapIndexBase.cs:line 64
   at Raven.Server.Documents.Indexes.Workers.MapDocuments.Execute(DocumentsOperationContext databaseContext, TransactionOperationContext indexContext, Lazy`1 writeOperation, IndexingStatsScope stats, CancellationToken token) in C:\Builds\RavenDB-4.0-Patch\src\Raven.Server\Documents\Indexes\Workers\MapDocuments.cs:line 108

Repro: https://github.com/tobiaszuercher/RavenDB-NodaTime/blob/feature/upgrade-v40/src/Sample/Program.cs

I don't understand how Raven.Bundles.NodaTime.NodaTimeField.AsInstant gets registered to the Server.

ryanheath commented 6 years ago

I have cloned your project but it seems to work ok.

I had to restart the ravendb server though, otherwise it will not pickup the added dlls.

HTH // Ryan

tobiaszuercher commented 6 years ago

hi @ryanheath, thank you for checking my sample out!

I had to restart the ravendb server though

i didn't forget that.

I have cloned your project but it seems to work ok.

the c# code goes through without issues. the studio tells me about the errors:

Image of Yaktocat Image of Yaktocat

does your index work?

ryanheath commented 6 years ago

At some point I did see that error too, but when I copied the dlls and restarted the server, the index was created without failures.

tobiaszuercher commented 6 years ago

i did copy NodaTime.dll and Raven.Bundles.NodaTime.dll into the same folder as the Raven.Server.exe. Did you put them into another folder?

tobiaszuercher commented 6 years ago

i could get it running now! i did wipe all the docs and restart from scratch. i dont understand why, but it works now!

thank you!

ryanheath commented 6 years ago

Glad it worked out for you! :)

// Ryan

On Tue, 10 Jul 2018 at 09:38, Tobias Zürcher notifications@github.com wrote:

i could get it running now! i did wipe all the docs and restart from scratch. i dont understand why, but it works now!

thank you!

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/mj1856/RavenDB-NodaTime/issues/18#issuecomment-403730162, or mute the thread https://github.com/notifications/unsubscribe-auth/AAq0XoR4ucyYCsUV6bBZ7tKkNbzqJDP4ks5uFFn1gaJpZM4UCOPq .

markzielinski commented 6 years ago

Hi, great work on this. Has there been a NuGet package released with support for RavenDB 4.x yet?

ryanheath commented 6 years ago

No, I’m waiting for 4.0.6 to come out officially. I don’t want to make a release on a patched version. It could be anytime now ...

// Ryan

On Wed, 1 Aug 2018 at 01:49, Mark Zielinski notifications@github.com wrote:

Hi, great work on this. Has there been a NuGet package released with support for RavenDB 4.x yet?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/mj1856/RavenDB-NodaTime/issues/18#issuecomment-409403741, or mute the thread https://github.com/notifications/unsubscribe-auth/AAq0XhiLJX9DrUTnbLenHRtwhY-TQ609ks5uMOz_gaJpZM4UCOPq .

markzielinski commented 6 years ago

Thanks for the update. I actually just went ahead and built my own quick extension to serialize Instant types which was quicker for me than waiting it out for the package.

ryanheath commented 6 years ago

Yes, that is possible but there are some corner case which do not work out of the box. Hopefully they will release a 'good' version any time soon ...

// Ryan

ryanheath commented 6 years ago

RavenDB 4.0.6 is released!

ryanheath commented 6 years ago

Released v4.0.0 fe48505462342ba05273607292f740d0c8ec204f