Fetch function in database toolbox freezes MATLAB

조회 수: 1 (최근 30일)
Nasser Hosseini
Nasser Hosseini 2016년 12월 2일
댓글: Dhruvesh Patel 2016년 12월 28일
I'm running MATLAB 2014b with Database Toolbox. I'm trying to fetch data from a database. It runs satisfactory for a while until the Fetch function suddenly freezes the whole session. Exactly the same behaviour can turn up when I run compiled .exe file of the script! What can be the reason for this behaviour?
conn = database('Remus2', '...', '...');
logintimeout(3);
logintimeout('sun.jdbc.odbc.JdbcOdbcResultSet', 3);
logintimeout('com.mathworks.toolbox.database.sqlExec', 3);
logintimeout('sun.jdbc.odbc.JdbcOdbcStatement', 3);
logintimeout('com.mathworks.toolbox.database.fetchTheData', 10);
curs_svarsfil_svar1 = exec(conn, [...
'SELECT svarsfil, svarsfil_ext, utlat_nr, svarsfil_status, case_id '...
'FROM svarsfil '...
'WHERE case_id=' ch_case_id_string ' AND svarsfil_status=utlat_nr '...
'ORDER BY 1;'...
]);
disp('Connect OK!')
try
disp('Trying to fetch...')
curs_svarsfil_svar2 = fetch(curs_svarsfil_svar1);
imFilDat = curs_svarsfil_svar2.Data;
catch
imFilDat = [];
end
close(curs_svarsfil_svar1);
close(curs_svarsfil_svar2);
close(conn);
  댓글 수: 1
Dhruvesh Patel
Dhruvesh Patel 2016년 12월 28일
Hi Nasser,
I understand that your MATLAB freezes while executing the script attached to the question.
There could be several reasons for the behavior that you are observing like:
  1. The amount of data you are trying to fetch is very large.
  2. The system does not register the 'logintimeout()' since it is after the call to 'database()'.
It would be helpful in finding the exact issue for the observed behavior if you share the details about the database, the driver, server machine details and the client machine details.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by