Discussion:
[nhusers] NHibernate with Oracle and nls_lang
Felipe Oriani
2018-03-27 15:08:05 UTC
Permalink
Hey guys,

We have an application using NHibernate with Oracle 11g and configured to
use the Oracle Managed DataAccess provider. It works fine in a lot fo
environtments, but in a single enrivonment, we are having problems with
NLS_LANG configuration and every query that extract information from
database comes with special chars like ã á ç õ and etc.

I know we can define NSL_LANG on the System Environment Variables on the
Windows but it affect other applications that are running on the same
server.

I would like to know if is there any way to define NLS_LANG on the
application layer or the IIS, or on the NHibernate configuration
(hibernate.cfg.xml) ?

Thank you
--
______________________________________
Felipe B Oriani
***@gmail.com
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
Carlos Alberto Costa Beppler
2018-04-05 13:22:22 UTC
Permalink
It depends on type of web application, but in general you can set the
environment for your process.

Uses Environment.SetEnvironmentVariable to set the NLS_LANG on beginning of
your application.

You can put the call on Application_Start of Global.asax.cs if your
application is using Web Forms (or old MVC).

If your application is using ASP.NET WebApi, you can put the call on
Startup.Configuration method.

On ASP.NET Core you can put the call on Program.Main, before run the host.
Post by Felipe Oriani
Hey guys,
We have an application using NHibernate with Oracle 11g and configured to
use the Oracle Managed DataAccess provider. It works fine in a lot fo
environtments, but in a single enrivonment, we are having problems with
NLS_LANG configuration and every query that extract information from
database comes with special chars like ã á ç õ and etc.
I know we can define NSL_LANG on the System Environment Variables on the
Windows but it affect other applications that are running on the same
server.
I would like to know if is there any way to define NLS_LANG on the
application layer or the IIS, or on the NHibernate configuration
(hibernate.cfg.xml) ?
Thank you
--
______________________________________
Felipe B Oriani
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
Loading...