From: Paul H. <pha...@us...> - 2005-03-01 16:25:23
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5548/nhibernate/src/NHibernate/Cache Modified Files: ICacheConcurrencyStrategy.cs NonstrictReadWriteCache.cs ReadOnlyCache.cs ReadWriteCache.cs Added Files: ISoftLock.cs Log Message: Various refactorings on the way to 2.1 querying capability Index: ReadOnlyCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadOnlyCache.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ReadOnlyCache.cs 31 Dec 2004 15:24:29 -0000 1.8 --- ReadOnlyCache.cs 1 Mar 2005 16:24:43 -0000 1.9 *************** *** 53,57 **** /// </summary> /// <param name="key"></param> ! public void Lock( object key ) { log.Error( "Application attempted to edit read only item: " + key ); --- 53,57 ---- /// </summary> /// <param name="key"></param> ! public ISoftLock Lock( object key ) { log.Error( "Application attempted to edit read only item: " + key ); *************** *** 83,87 **** /// </summary> /// <param name="key"></param> ! public void Release( object key ) { log.Error( "Application attempted to edit read only item: " + key ); --- 83,88 ---- /// </summary> /// <param name="key"></param> ! /// <param name="lock"></param> ! public void Release( object key, ISoftLock @lock ) { log.Error( "Application attempted to edit read only item: " + key ); Index: ReadWriteCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ReadWriteCache.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ReadWriteCache.cs 31 Dec 2004 15:24:29 -0000 1.7 --- ReadWriteCache.cs 1 Mar 2005 16:24:43 -0000 1.8 *************** *** 70,75 **** /// </summary> /// <param name="key"></param> ! public void Lock( object key ) { lock( lockObject ) { --- 70,76 ---- /// </summary> /// <param name="key"></param> ! public ISoftLock Lock( object key ) { + // TODO: Differs from the 2.1 implementation lock( lockObject ) { *************** *** 87,90 **** --- 88,93 ---- _cache.Put( key, item ); } + + return null; } *************** *** 133,137 **** /// </summary> /// <param name="key"></param> ! public void Release( object key ) { lock( lockObject ) --- 136,141 ---- /// </summary> /// <param name="key"></param> ! /// <param name="lock"></param> ! public void Release( object key, ISoftLock @lock ) { lock( lockObject ) Index: NonstrictReadWriteCache.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/NonstrictReadWriteCache.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NonstrictReadWriteCache.cs 31 Dec 2004 15:24:29 -0000 1.4 --- NonstrictReadWriteCache.cs 1 Mar 2005 16:24:43 -0000 1.5 *************** *** 93,100 **** /// </summary> /// <param name="key"></param> ! public void Lock( object key ) { // in case the server crashes, we need the lock to timeout _cache.Put( key, ( timeout + Timestamper.Next()/Timestamper.OneMs ) ); } --- 93,103 ---- /// </summary> /// <param name="key"></param> ! public ISoftLock Lock( object key ) { + // TODO: Differs from the 2.1 implemenation // in case the server crashes, we need the lock to timeout _cache.Put( key, ( timeout + Timestamper.Next()/Timestamper.OneMs ) ); + + return null; } *************** *** 103,107 **** /// </summary> /// <param name="key"></param> ! public void Release( object key ) { if( log.IsDebugEnabled ) --- 106,111 ---- /// </summary> /// <param name="key"></param> ! /// <param name="lock"></param> ! public void Release( object key, ISoftLock @lock ) { if( log.IsDebugEnabled ) --- NEW FILE: ISoftLock.cs --- using System; namespace NHibernate.Cache { /// <summary> /// Marker interface, denoting a client-visible "soft lock" on a cached item. /// </summary> public interface ISoftLock { } } Index: ICacheConcurrencyStrategy.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/ICacheConcurrencyStrategy.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ICacheConcurrencyStrategy.cs 31 Dec 2004 15:24:29 -0000 1.5 --- ICacheConcurrencyStrategy.cs 1 Mar 2005 16:24:43 -0000 1.6 *************** *** 40,44 **** /// <param name="key">The key</param> /// <exception cref="CacheException"></exception> ! void Lock( object key ); /// <summary> --- 40,45 ---- /// <param name="key">The key</param> /// <exception cref="CacheException"></exception> ! /// <remarks>This method is used by "asynchronous" concurrency strategies.</remarks> ! ISoftLock Lock( object key ); /// <summary> *************** *** 46,51 **** /// </summary> /// <param name="key">The key</param> /// <exception cref="CacheException"></exception> ! void Release( object key ); /// <summary> --- 47,74 ---- /// </summary> /// <param name="key">The key</param> + /// <param name="lock">The soft lock</param> /// <exception cref="CacheException"></exception> ! void Release( object key, ISoftLock @lock ); ! ! /* ! /// <summary> ! /// Called after an item has been updated (after the transaction completes), instead of calling Release(). ! /// </summary> ! /// <param name="key"></param> ! /// <param name="value"></param> ! /// <param name="version"></param> ! /// <param name="?"></param> ! /// <remarks>This method is used by "asynchronous" concurrency strategies.</remarks> ! void AfterUpdate(object key, object value, object version, SoftLock lock) throws CacheException; ! ! /// <summary> ! /// Called after an item has been inserted (after the transaction completes), instead of calling release(). ! /// </summary> ! /// <param name="key"></param> ! /// <param name="value"></param> ! /// <param name="version"></param> ! /// <remarks>This method is used by "asynchronous" concurrency strategies.</remarks> ! public void AfterInsert(object key, object value, object version) throws CacheException; ! */ /// <summary> |