我们在MariaDB中有一个存储过程,它在服务器上运行良好,但是当我们从客户端使用JDBC运行它时,我们得到了第一行,但后来它总是失败:
unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
表loan_balances2
不是太大,大约600 K行。这是存储过程,您看到任何问题了吗?谢谢!
CREATE PROCEDURE `get_loan_balances_sample`()
BEGIN
drop table if exists all_loan_ids;
drop table if exists random_loan_ids;
create table all_loan_ids as select distinct loan_id from loan_balances2;
create table random_loan_ids as select * from all_loan_ids order by RAND() limit 50;
SELECT * FROM loan_balances2
where loan_id in (select Loan_ID from random_loan_ids)
order by Loan_ID, balance_date;
END
1条答案
按热度按时间hwamh0ep1#
通常是net_write_timeout。如果应用程序阅读数据的速度不如服务器写入数据的速度快,则服务器将关闭套接字。net_write_timeout时间限制,以秒为单位,表示服务器在尝试发送结果集时可以停留的时间。您可以增加该限制,它是一个会话变量。这也出现在MariaDB JDBC的FAQ中