Review Board 1.7.22


Sqoop2: Show connection and job command hung

Review Request #10331 - Created April 7, 2013 and updated

Vasanth kumar RJ
sqoop-980
Reviewers
Sqoop
sqoop-sqoop2
Show connection and job command hung when connection or job records size more than 8.
Problem while invoking prepareStatement method.
Done

Diff revision 2 (Latest)

1 2
1 2

  1. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...
repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
Revision 486635d New Change
[20] 1177 lines
[+20] [+] private Counters loadCountersSubmission(long submissionId, Connection conn) throws SQLException {
1178
    PreparedStatement inputFetchStmt = null;
1178
    PreparedStatement inputFetchStmt = null;
1179

    
   
1179

   
1180
    try {
1180
    try {
1181
      rsConnection = stmt.executeQuery();
1181
      rsConnection = stmt.executeQuery();
1182

    
   
1182

   

    
   
1183
      formConnectorFetchStmt = conn.prepareStatement(STMT_FETCH_FORM_CONNECTOR);

    
   
1184
      formFrameworkFetchStmt = conn.prepareStatement(STMT_FETCH_FORM_FRAMEWORK);

    
   
1185
      inputFetchStmt = conn.prepareStatement(STMT_FETCH_CONNECTION_INPUT);

    
   
1186

   
1183
      while(rsConnection.next()) {
1187
      while(rsConnection.next()) {
1184
        long id = rsConnection.getLong(1);
1188
        long id = rsConnection.getLong(1);
1185
        String name = rsConnection.getString(2);
1189
        String name = rsConnection.getString(2);
1186
        long connectorId = rsConnection.getLong(3);
1190
        long connectorId = rsConnection.getLong(3);
1187
        Date creationDate = rsConnection.getTimestamp(4);
1191
        Date creationDate = rsConnection.getTimestamp(4);
1188
        Date lastUpdateDate = rsConnection.getTimestamp(5);
1192
        Date lastUpdateDate = rsConnection.getTimestamp(5);
1189

    
   
1193

   
1190
        formConnectorFetchStmt =

   
1191
          conn.prepareStatement(STMT_FETCH_FORM_CONNECTOR);

   
1192
        formConnectorFetchStmt.setLong(1, connectorId);
1194
        formConnectorFetchStmt.setLong(1, connectorId);
1193

    
   
1195

   
1194
        formFrameworkFetchStmt =

   
1195
          conn.prepareStatement(STMT_FETCH_FORM_FRAMEWORK);

   
1196

    
   

   
1197
        inputFetchStmt = conn.prepareStatement(STMT_FETCH_CONNECTION_INPUT);

   
1198
        inputFetchStmt.setLong(1, id);
1196
        inputFetchStmt.setLong(1, id);
1199
        //inputFetchStmt.setLong(2, XXX); // Will be filled by loadForms
1197
        //inputFetchStmt.setLong(2, XXX); // Will be filled by loadForms
1200
        inputFetchStmt.setLong(3, id);
1198
        inputFetchStmt.setLong(3, id);
1201

    
   
1199

   
1202
        List<MForm> connectorConnForms = new ArrayList<MForm>();
1200
        List<MForm> connectorConnForms = new ArrayList<MForm>();
[+20] [20] 39 lines
[+20] private Counters loadCountersSubmission(long submissionId, Connection conn) throws SQLException {
1242
    PreparedStatement inputFetchStmt = null;
1240
    PreparedStatement inputFetchStmt = null;
1243

    
   
1241

   
1244
    try {
1242
    try {
1245
      rsJob = stmt.executeQuery();
1243
      rsJob = stmt.executeQuery();
1246

    
   
1244

   

    
   
1245
      formConnectorFetchStmt = conn.prepareStatement(STMT_FETCH_FORM_CONNECTOR);

    
   
1246
      formFrameworkFetchStmt = conn.prepareStatement(STMT_FETCH_FORM_FRAMEWORK);

    
   
1247
      inputFetchStmt = conn.prepareStatement(STMT_FETCH_JOB_INPUT);

    
   
1248

   
1247
      while(rsJob.next()) {
1249
      while(rsJob.next()) {
1248
        long connectorId = rsJob.getLong(1);
1250
        long connectorId = rsJob.getLong(1);
1249
        long id = rsJob.getLong(2);
1251
        long id = rsJob.getLong(2);
1250
        String name = rsJob.getString(3);
1252
        String name = rsJob.getString(3);
1251
        long connectionId = rsJob.getLong(4);
1253
        long connectionId = rsJob.getLong(4);
1252
        String stringType = rsJob.getString(5);
1254
        String stringType = rsJob.getString(5);
1253
        Date creationDate = rsJob.getTimestamp(6);
1255
        Date creationDate = rsJob.getTimestamp(6);
1254
        Date lastUpdateDate = rsJob.getTimestamp(7);
1256
        Date lastUpdateDate = rsJob.getTimestamp(7);
1255

    
   
1257

   
1256
        MJob.Type type = MJob.Type.valueOf(stringType);
1258
        MJob.Type type = MJob.Type.valueOf(stringType);
1257

    
   
1259

   
1258
        formConnectorFetchStmt =

   
1259
          conn.prepareStatement(STMT_FETCH_FORM_CONNECTOR);

   
1260
        formConnectorFetchStmt.setLong(1, connectorId);
1260
        formConnectorFetchStmt.setLong(1, connectorId);
1261

    
   
1261

   
1262
        formFrameworkFetchStmt =

   
1263
          conn.prepareStatement(STMT_FETCH_FORM_FRAMEWORK);

   
1264

    
   

   
1265
        inputFetchStmt = conn.prepareStatement(STMT_FETCH_JOB_INPUT);

   
1266
        inputFetchStmt.setLong(1, id);
1262
        inputFetchStmt.setLong(1, id);
1267
        //inputFetchStmt.setLong(1, XXX); // Will be filled by loadForms
1263
        //inputFetchStmt.setLong(1, XXX); // Will be filled by loadForms
1268
        inputFetchStmt.setLong(3, id);
1264
        inputFetchStmt.setLong(3, id);
1269

    
   
1265

   
1270
        List<MForm> connectorConnForms = new ArrayList<MForm>();
1266
        List<MForm> connectorConnForms = new ArrayList<MForm>();
[+20] [20] 399 lines
  1. repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java: Loading...