forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIBatchableCacheConcurrencyStrategy.cs
47 lines (45 loc) · 2.09 KB
/
IBatchableCacheConcurrencyStrategy.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections;
using System.Text;
using NHibernate.Cache.Entry;
namespace NHibernate.Cache
{
/// <summary>
/// Implementors manage transactional access to cached data.
/// </summary>
/// <remarks>
/// <para>
/// Transactions pass in a timestamp indicating transaction start time.
/// </para>
/// <para>
/// When used to cache entities and collections the key is the identifier of the
/// entity/collection and the value should be set to the <see cref="CacheEntry"/>
/// for an entity and the results of <see cref="Collection.AbstractPersistentCollection.Disassemble"/>
/// for a collection.
/// </para>
/// </remarks>
public partial interface IBatchableCacheConcurrencyStrategy : ICacheConcurrencyStrategy
{
/// <summary>
/// Attempt to retrieve multiple objects from the Cache
/// </summary>
/// <param name="keys">The keys (id) of the objects to get out of the Cache.</param>
/// <param name="timestamp">A timestamp prior to the transaction start time</param>
/// <returns>An array of cached objects or <see langword="null" /></returns>
/// <exception cref="CacheException"></exception>
object[] GetMany(CacheKey[] keys, long timestamp);
/// <summary>
/// Attempt to cache objects, after loading them from the database.
/// </summary>
/// <param name="keys">The keys (id) of the objects to put in the Cache.</param>
/// <param name="values">The objects to put in the cache.</param>
/// <param name="timestamp">A timestamp prior to the transaction start time.</param>
/// <param name="versions">The version numbers of the objects we are putting.</param>
/// <param name="versionComparers">The comparers to be used to compare version numbers</param>
/// <param name="minimalPuts">Indicates that the cache should avoid a put if the item is already cached.</param>
/// <returns><see langword="true" /> if the objects were successfully cached.</returns>
/// <exception cref="CacheException"></exception>
bool[] PutMany(CacheKey[] keys, object[] values, long timestamp, object[] versions, IComparer[] versionComparers,
bool[] minimalPuts);
}
}