internal static RepositoryStream GetBinaryStream2(int nodeId, int versionId, int propertyTypeId)
{
if (TransactionScope.IsActive)
{
// Aktív tranzakció hekk
var bce = DataProvider.Current.LoadBinaryCacheEntity(versionId, propertyTypeId);
if (bce.RawData == null)
return new RepositoryStream(bce.Length, bce.BinaryPropertyId);
else
return new RepositoryStream(bce.Length, bce.RawData);
}
// Nézzük meg a cache-ben ezt az adatot először...
string cacheKey = string.Concat("RawBinary.", versionId, ".", propertyTypeId);
var binaryCacheEntity = (BinaryCacheEntity)DistributedApplication.Cache.Get(cacheKey);
if (binaryCacheEntity == null)
{
binaryCacheEntity = DataProvider.Current.LoadBinaryCacheEntity(versionId, propertyTypeId);
if (binaryCacheEntity != null)
{
if (!RepositoryConfiguration.WorkingModeIsPopulating)
DistributedApplication.Cache.Insert(cacheKey, binaryCacheEntity, new NodeIdDependency(nodeId));
}
}
if (binaryCacheEntity == null)
return null;
if (binaryCacheEntity.Length == -1)
return null;
RepositoryStream stream;
if (binaryCacheEntity.RawData == null)
stream = new RepositoryStream(binaryCacheEntity.Length, binaryCacheEntity.BinaryPropertyId);
else
stream = new RepositoryStream(binaryCacheEntity.Length, binaryCacheEntity.RawData);
return stream;
}
internal static Stream GetBinaryStream(int nodeVersionId, int propertyTypeId)