Hi,

One of our test fails migrating to DO5, we have a null type info in one case. I don't have code to reproduce it however you might have an idea of what's happening :

![alt text][1] ![alt text][2]

[1]: http://support.x-tensive.com/upfiles/VS2012 DO4.png

[2]: http://support.x-tensive.com/upfiles/vs2012 DO5.png

Regards, Benoit

asked Sep 16 '16 at 04:32

Benoit%20Nesme's gravatar image

Benoit Nesme
13111316


One Answer:

Hello,

Key.ResolveTypeInfo() method was introduced in 5.0.x. The code which was in Key.TypeInfo in 4.6.x moved to that method. Key.TypeInfo of 5.0.x will return null if Key.TypeReference.Accuracy is not TypeReferenceAccuracy.ExactType.

answered Sep 20 '16 at 03:54

Alexey%20Kulakov's gravatar image

Alexey Kulakov
45215

Ok, thanks this solves our issue however it requires a opened session which is not what we had in all cases. We have a workaround for now opening a session if Session.Current is null, but it's rather ugly.

(Sep 20 '16 at 06:58) Benoit Nesme Benoit%20Nesme's gravatar image

In 4.6 Key.TypeInfo returns null if there is no active session. If you need 100% same behavior you may write a sort of extension for Key type or a helper which will return null if Session.Current is null otherwise return Key.ResolveTypeInfo(Session.Current)

(Sep 20 '16 at 07:21) Alexey Kulakov Alexey%20Kulakov's gravatar image

Ok I see, but we didn't have this problem in 4.6. Was it because we were using AutoTransactionOpenMode that was transparently opening a session in that case ?

(Sep 20 '16 at 07:27) Benoit Nesme Benoit%20Nesme's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×4
×1

Asked: Sep 16 '16 at 04:32

Seen: 2,343 times

Last updated: Sep 20 '16 at 07:27

powered by OSQA