Skip to content

NH-4023 - Passing session to type getter and setter #637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 2, 2017

Conversation

fredericDelaporte
Copy link
Member

@fredericDelaporte fredericDelaporte commented May 31, 2017

NH-4023 for solving time issues for some databases.
NH-1851 MySql
NH-3078 Sybase Anywhere
NH-4017 Npgsql 3
NH-4024 ODBC

Maybe a replacement for #635 and #631.

But has a heavy impact on types, which may hinders UserType as shown in test project: it seems frequent to delegate the set/get of an user type to a NHibernate type. But with that change, that will require the session. And the user type will not have it.

@hazzik
Copy link
Member

hazzik commented May 31, 2017

I think ISessionImplementor can be too much.
EDIT: gave it another thought and checked what Hibernate does.

Copy link
Member

@hazzik hazzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hazzik
Copy link
Member

hazzik commented May 31, 2017

ODBC driver also requires TimeSpan

@hazzik
Copy link
Member

hazzik commented May 31, 2017

On Hibernate side UserType has SharedSessionContractImplementor session (which is an equivalent of our ISessionImplementor) parameter in nullSafeGet and nullSafeSet methods, so I think we should do the same.

@fredericDelaporte
Copy link
Member Author

On Hibernate side UserType has SharedSessionContractImplementor session

I have seen that Hibernate was not shy about passing that around, enforcing my decision for NullableType. But I have had not checked what is was for IUserType, thanks

I am ok with changing it too. Sure breaking change, but not doing it would be worst I think.

@fredericDelaporte
Copy link
Member Author

fredericDelaporte commented Jun 1, 2017

ODBC driver also requires TimeSpan

Thanks. Should I update the tests result files by the way, for avoiding hiding those newly fixed cases? But it may enable some flaky test, if they have succeeded in the run from which I would take a new result file.

@hazzik
Copy link
Member

hazzik commented Jun 1, 2017

Should I update the tests result files by the way, for avoiding hiding those newly fixed cases?

I think the goal shall be to have no red tests at all. So, we either need to fix them, or ignore them.

@@ -63,9 +63,9 @@ public System.Type ReturnedType
get { return typeof(Int32); }
}

public object NullSafeGet(DbDataReader rs, string[] names, object owner)
public object NullSafeGet(DbDataReader rs, string[] names, ISessionImplementor session, object owner)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hazzik hazzik modified the milestone: 5.0.0 Jun 2, 2017
@hazzik hazzik changed the title NH-4023 passing session to type getter and setter NH-4023 - Passing session to type getter and setter Jun 2, 2017
@hazzik hazzik merged commit 7ffa17a into nhibernate:master Jun 2, 2017
@fredericDelaporte fredericDelaporte deleted the NH-4017-2 branch June 2, 2017 12:29
@hazzik hazzik added the r: Fixed label Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants