Niner
Niner

Reputation: 2205

How to set Oracle ClientId field in nHibernate?

Through the use of nHibernate library, is there a way to set the Oracle ClientId off of the connection object? If nHibernate does not support the setting of the ClientId field, what can I do to assign a custom string to my Oracle connection object obtained from nHibernate? Thanks.

Upvotes: 1

Views: 212

Answers (2)

cremor
cremor

Reputation: 6876

You should create a class that inherits from DriverConnectionProvider and overrides GetConnection(). There you can modify the IDbConnection object. Of course you also need to configure this class in the NHibernate SessionFactory configuration, for example in hibernate.cfg.xml.

Upvotes: 1

Oskar Berggren
Oskar Berggren

Reputation: 5629

The connection is available as session.Connection.

Upvotes: 1

Related Questions