----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/35288/#review87960 -----------------------------------------------------------
There are a few different ways to do this. I think using synchronize is not really fine grained enough. Given that this is a step in the right direction though, how about the following adjustment: Instead of synchronizing on the purge thread and waiting on the purge thread to stop accessing the database, why not synchronize on the JobManager object instead? - Abraham Elmahrek On June 11, 2015, 10:19 a.m., Dian Fu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/35288/ > ----------------------------------------------------------- > > (Updated June 11, 2015, 10:19 a.m.) > > > Review request for Sqoop. > > > Bugs: SQOOP-2396 > https://issues.apache.org/jira/browse/SQOOP-2396 > > > Repository: sqoop-sqoop2 > > > Description > ------- > > Exception in thread "PurgeThread" org.apache.sqoop.common.SqoopException: > JDBCREPO_0009:Failed to finalize transaction > at > org.apache.sqoop.repository.JdbcRepositoryTransaction.close(JdbcRepositoryTransaction.java:115) > at > org.apache.sqoop.repository.JdbcRepository.doWithConnection(JdbcRepository.java:109) > at > org.apache.sqoop.repository.JdbcRepository.doWithConnection(JdbcRepository.java:61) > at > org.apache.sqoop.repository.JdbcRepository.purgeSubmissions(JdbcRepository.java:589) > at org.apache.sqoop.driver.JobManager$PurgeThread.run(JobManager.java:648) > Caused by: java.sql.SQLNonTransientConnectionException: No current connection. > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown > Source) > at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) > at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) > at org.apache.derby.impl.jdbc.Util.noCurrentConnection(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection.checkIfClosed(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection.setupContextStack(Unknown > Source) > at org.apache.derby.impl.jdbc.EmbedConnection.commit(Unknown Source) > at > org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334) > at > org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334) > at > org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:211) > at > org.apache.sqoop.repository.JdbcRepositoryTransaction.close(JdbcRepositoryTransaction.java:112) > ... 4 more > Caused by: java.sql.SQLException: No current connection. > at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown > Source) > at > org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown > Source) > ... 15 more > Verification was successful. > Tool class org.apache.sqoop.tools.tool.VerifyTool has finished correctly. > > > Diffs > ----- > > core/src/main/java/org/apache/sqoop/driver/JobManager.java e8ca17c > > Diff: https://reviews.apache.org/r/35288/diff/ > > > Testing > ------- > > > Thanks, > > Dian Fu > >
