I'm using NHibernate version 1.0.2 and I've discovered a bug with 2nd level caching when creating a session with an existing database connection. When using the following overload:
Code:
ISession OpenSession( IDbConnection connection );
The txTimestamp is passed through as long.MinValue which then causes problems with inserting items into the cache.
The following will address this problem:
Code:
private ISession OpenSession( IDbConnection connection, bool autoClose, IInterceptor interceptor )
{
long timestamp = Timestamper.Next();
return new SessionImpl( connection, this, autoClose, timestamp, interceptor );
}
The creation of the timestamp was promoted to the private implementation and removed from the public overloads. Due to my limited understanding of NH internals, I need to know if this will cause any problems?