Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
param123
Creator
Creator

[Amazon](600001) The server closed the connection

Hi,

 

I am trying to get huge amount of data from Redshift to Mysql. the query usually will runs for more than 24 hours. however i am getting the error "[Amazon](600001) The server closed the connection"

Please suggest how to resolve the issue

Labels (3)
2 Replies
Anonymous
Not applicable

Hello,

It seems that the server terminated abnormally before or while processing the request.

Best regards

Sabrina

Anonymous
Not applicable

1、 I think talend should support jdbc pool,this is will keep connection alive; In talend runtime environment, it looks like support jdbc pool,but I never try it.We run talend shell in our linux server,and schedule by control-m or azkaban.
2、I met the same problem,and I use java script ,run thread to keep connection alive,Talend flow and java script as below.

0683p000009M9c7.png

new Thread(new Runnable() {
            @Override
            public void run() {
            while(true){
            	java.sql.PreparedStatement pst = null;
            	java.sql.ResultSet rSet = null;
            	try {
            		System.out.println(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date()) + "----keep connection alive----");
            		String sqlStringC = " SELECT 'x' ";
					pst = ((java.sql.Connection) globalMap.get("conn_tDBConnection_1")).prepareStatement(sqlStringC);
					rSet = pst.executeQuery();
                    Thread.sleep(60000);
                } catch (Exception e) {
                    e.printStackTrace();
                }finally{
                	if(rSet != null){
						try {
							rSet.close();
						} catch (Exception e) {
							e.printStackTrace();
						}
					}
					if(pst != null){
						try {
							pst.close();
						} catch (Exception e) {
							e.printStackTrace();
						}
					}
                }

	           }
            }
        }).start();

3、also,you can contact your DBA,change database system parameters,but this is not a good idea,it will bring other database problems.