Skip to content

SAP HANA and .NET Core #2154

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

Closed
MMMMDCCXI opened this issue May 8, 2019 · 6 comments
Closed

SAP HANA and .NET Core #2154

MMMMDCCXI opened this issue May 8, 2019 · 6 comments

Comments

@MMMMDCCXI
Copy link

Since version 5.2 NHibernate supports HANA as database system.
Is there a way to run it under .NET Core ?

SAP provides with the HANA Client Version 2.4 (HANA SPS04) a .NET Core driver.

@bahusoid
Copy link
Member

bahusoid commented May 8, 2019

Can you provide some details what's stopping you?

It seems you can easily implement custom version of driver based on this file

@MMMMDCCXI
Copy link
Author

Sometimes you just need a little nudge.
Thanks, I didn't think it would be that easy.

public class HANACoreDriver : NHibernate.Driver.ReflectionBasedDriver
{

    public HANACoreDriver() : base("Sap.Data.Hana", "Sap.Data.Hana.Core.v2.1", "Sap.Data.Hana.HanaConnection", "Sap.Data.Hana.HanaCommand")
    { }
    public override bool UseNamedPrefixInSql => false;
    public override bool UseNamedPrefixInParameter => false;
    public override string NamedPrefix => string.Empty;
}

@bahusoid
Copy link
Member

bahusoid commented May 8, 2019

It seems you should override more members to take full advantage (like GetResultSetsCommand ). I provided wrong example file initially. Use this

@MMMMDCCXI
Copy link
Author

Thanks, I adjusted it.

@adrien-constant
Copy link

It's very useful @MMMMDCCXI thank you
Shouldn't it be part of nhibernate source code ? If running on .NET Core, using the .NET Core HANA driver by default. It would make sense.

@fredericDelaporte
Copy link
Member

It could be better to publish a new Nuget package just for the driver, which could use explicit dependencies instead of relying on reflection. See #626.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants