sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-2513: Sqoop2: Deadlock occurs between getJobStatus and JobManager.UpdateThread#updateSubmission
Date Tue, 25 Aug 2015 15:50:39 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 3668aea7d -> 826e5cc77


SQOOP-2513: Sqoop2: Deadlock occurs between getJobStatus and JobManager.UpdateThread#updateSubmission

(Dian Fu via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/826e5cc7
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/826e5cc7
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/826e5cc7

Branch: refs/heads/sqoop2
Commit: 826e5cc774b4ec9999950dbecc662950c0190358
Parents: 3668aea
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Aug 25 08:50:01 2015 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Aug 25 08:50:01 2015 -0700

----------------------------------------------------------------------
 .../repository/common/CommonRepositoryHandler.java    | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/826e5cc7/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
----------------------------------------------------------------------
diff --git a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
b/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
index b36e685..af9324f 100644
--- a/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
+++ b/repository/repository-common/src/main/java/org/apache/sqoop/repository/common/CommonRepositoryHandler.java
@@ -622,13 +622,9 @@ public abstract class CommonRepositoryHandler extends JdbcRepositoryHandler
{
    */
   @Override
   public void updateJob(MJob job, Connection conn) {
-    try (PreparedStatement deleteStmt = conn.prepareStatement(crudQueries.getStmtDeleteJobInput());
-         PreparedStatement updateStmt = conn.prepareStatement(crudQueries.getStmtUpdateJob());)
{
-      // Firstly remove old values
-      deleteStmt.setLong(1, job.getPersistenceId());
-      deleteStmt.executeUpdate();
-
-      // Update job table
+    try (PreparedStatement updateStmt = conn.prepareStatement(crudQueries.getStmtUpdateJob());
+         PreparedStatement deleteStmt = conn.prepareStatement(crudQueries.getStmtDeleteJobInput());)
{
+      // Firstly update job table
       updateStmt.setString(1, job.getName());
       updateStmt.setString(2, job.getLastUpdateUser());
       updateStmt.setTimestamp(3, new Timestamp(new Date().getTime()));
@@ -636,6 +632,10 @@ public abstract class CommonRepositoryHandler extends JdbcRepositoryHandler
{
       updateStmt.setLong(4, job.getPersistenceId());
       updateStmt.executeUpdate();
 
+      // Secondly remove old values
+      deleteStmt.setLong(1, job.getPersistenceId());
+      deleteStmt.executeUpdate();
+
       // And reinsert new values
       createInputValues(crudQueries.getStmtInsertJobInput(),
           job.getPersistenceId(),


Mime
View raw message