How to use Oracle's Session State Provider

I'm trying to get the Oracle Session State provider to work with an existing project.  It looks like it should be simple, just install the client and add a few lines to your web.config file.  Unfortunately, it doesn't seem to be working for me.

When I try to access the website, I get a ConfigurationErrorsException, saying that it couldn't initialize the oracle connection object.  As far as I know the syntax is correct, and the value is too, so I'm not sure what I'm doing wrong.

Attached is the important bits of the web.config file.
<connectionStrings>
    <add name="SessionConnection"
         connectionString="Provider=OraOLEDB.Oracle;Data Source=DNTEST1;User Id=x;Password=y;Database=VITAL_STATISTICS"/>
  </connectionStrings>
 
    <sessionState mode="Custom" customProvider="MyOracleSessionStateStore">
	<providers>
            <add name="MyOracleSessionStateStore"
                connectionStringName="SessionConnection"
                type="Oracle.Web.SessionState.OracleSessionStateStore, Oracle.Web, Version=2.111.6.20, Culture=neutral, PublicKeyToken=89b483f429c47342"
            />
	</providers>
</sessionState>

Open in new window

Sam_CharetteAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Did you find a solution?

Bob
0
Sam_CharetteAuthor Commented:
Nope.
0
Bob LearnedCommented:
Do you have the Oracle .NET Data Provider (ODP.NET) installed?

Bob
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Sam_CharetteAuthor Commented:
Yes, I do.
0
Bob LearnedCommented:
I don't remember having to put the provider in the connection string:

    Provider=OraOLEDB.Oracle;

With the SQL Server provider, you can't put the provider in the string, since it is known by the SqlClient provider.

Bob
0
Sam_CharetteAuthor Commented:
Unfortunately this didn't seem to help either. :-/
0
Bob LearnedCommented:
I would test that by tryimg to use that connection string to create an OleConnection instance, and then try to open the connection.

Bob
0
Sam_CharetteAuthor Commented:
The exact same connection string is used elsewhere to create an OleConnection instance already.
0
Bob LearnedCommented:
Does your Oracle database instance have the necessary schema to handle session state?

Bob
0
Sam_CharetteAuthor Commented:
Yup.  As this is only a test, I added it to the schema of the application database.
0
Bob LearnedCommented:
Hmmm...I am at a loss, and it has been too long to remember the steps (I am using SQL Server now).  I would reask this question, if you didn't get an answer.

Bob
0
Sam_CharetteAuthor Commented:
Well thanks for trying :)
0
Sam_CharetteAuthor Commented:
We finally got it to work.  The problem was the connection string, and it looks nothing like I've ever seen before.  It actually should be this:

<connectionStrings>
<add name="SessionConnection" connectionString="Data
Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ORADEV1)(PORT=
1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DNTEST1)));User
Id=xxx;Password=yyy;"/>
</connectionStrings>

We found this at http://www.connectionstrings.com/?carrier=oracle .  You can find the connection string for your server by running "tnsping <server>" from the command line.
0
Computer101Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.