parfeval with fetch not working
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello guys. When I call the fetch() function with parfeval, I get the following error:
parfeval(@fetch,1,database,query)
Error: 'Dot indexing is not supported for variables of this type.'
On the other hand, without parfeval, the function works perfectly. What could it be?
댓글 수: 0
채택된 답변
Edric Ellis
2022년 7월 13일
You cannot pass database connection objects to workers directly like this. You should use createConnectionForPool . There are examples on that doc page that show you how to set up and use this. You'll end up with something like this:
c = createConnectionForPool(..);
% Wrap the call to "fetch" to unpick the .Value out of the pool connection
% object 'c'.
fut = parfeval(@(c, varargin) fetch(c.Value, varargin{:}), 1, c, query)
댓글 수: 1
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Background Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!