Hi David,
Am I meant to pull a new version of the code and compile/grab latest binaries?
Anyway...I tried the workaround you suggested with the code now looking like what is below (note the inclusion of
StatementCacheSize(100)). Unfortunately the error hasn't disappeared.
==========================================
return Fluently.Configure()
.Database( OracleClientConfiguration.Oracle9
.ConnectionString( c => c
.Server( "XXX" )
.Instance( "XXXUser" )
.Username( "XXXUser" )
.Password( "XXXUser" )
.StatementCacheSize( 100 ) )
.Cache( c => c
.UseQueryCache()
.ProviderClass<NHibernate.Cache.HashtableCacheProvider>() )
.ShowSql() )
.Mappings( m => m.FluentMappings.AddFromAssemblyOf<Category>() )
.BuildSessionFactory();
===========================================
I tried another route to solving the problem. Changed the code to look like this:
===========================================
var cfg = OracleClientConfiguration.Oracle9
.ConnectionString( c => c
.Is( "DATA SOURCE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.112)(PORT=1521))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME=XXX)));PERSIST SECURITY INFO=True;USER ID=XXXUser;Password=XXXUser" ) );
return Fluently.Configure()
.Database( cfg )
.Mappings( m => m
.FluentMappings.AddFromAssemblyOf<Category>() )
.BuildSessionFactory();
===========================================
This code resulted in no errors, but it wouldn't return any results. I am expecting a few rows from the Category table, but returns nothing.
I know I am doing everything right in so far as connecting to the database is concerned. By providing the wrong user details and wrong database names, I receive the expected exceptions.
Code to return the Category table:
===========================================
using ( var session = sessionFactory.OpenSession() )
{
using ( session.BeginTransaction() )
{
var category = session.CreateCriteria( typeof( Category ) )
.List<Category>();
foreach ( var cat in category )
{
// do something
}
}
}
===========================================