use of org.broadleafcommerce.common.util.StreamCapableTransactionalOperationAdapter in project BroadleafCommerce by BroadleafCommerce.
the class StaticAssetStorageServiceImpl method createBlob.
@Override
public Blob createBlob(final InputStream uploadedFileInputStream, final long fileSize) throws IOException {
final Blob[] blob = new Blob[1];
transUtil.runTransactionalOperation(new StreamCapableTransactionalOperationAdapter() {
@Override
public void execute() {
try {
blob[0] = staticAssetStorageDao.createBlob(uploadedFileInputStream, fileSize);
} catch (IOException e) {
LOG.error("Unable to create blob from InputStream.", e);
}
}
}, RuntimeException.class);
return blob[0];
}
Aggregations