0
  1. 它只是在 Kettle 5.4 中开发的最简单的 tran。
  2. tran 从 MSSQL 中提取数据并插入到另一个 MSSQL 中,无需任何其他操作。
  3. 我启用了“对插入使用批量更新”复选框。
  4. 通常它会成功运行并显示任何错误消息。
  5. 此错误偶尔会发生,并且无法通过重新运行 tran 来重现。

这是错误日志:

2016/09/18 08:00:36 - tb_dim_innchangelog.0 - SQL query : SELECT
2016/09/18 08:00:36 - tb_dim_innchangelog.0 -   StatID
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , ChainID
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , ChainName
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , SaleDepartID
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , AcivmntRegion
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , Category
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , Stage
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , BeginDate
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , EndDate
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , createtime
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , ChainFlag
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - , LastUpdateDate
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - FROM Dim_InnChangeLog
2016/09/18 08:00:36 - load_dim_innchangelog.0 - Prepared statement : INSERT INTO Dim_InnChangeLog (StatID, ChainID, ChainName, SaleDepartID, AcivmntRegion, Category, Stage, BeginDate, EndDate, createtime, ChainFlag, LastUpdateDate) VALUES ( ?,  ?,  ?,  ?,  ?,  ?,  ?,  ?,  ?,  ?,  ?,  ?)
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - Finished reading query, closing connection.
2016/09/18 08:00:36 - BussinessDW_Source - Connection to database closed!
2016/09/18 08:00:36 - tb_dim_innchangelog.0 - 完成处理 (I=19147, O=0, R=0, W=19147, U=0, E=0
2016/09/18 08:00:56 - load_dim_innchangelog.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : Because of an error, this step can't continue: 
2016/09/18 08:00:56 - load_dim_innchangelog.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseException: 
2016/09/18 08:00:56 - load_dim_innchangelog.0 - Error performing rollback on connection
2016/09/18 08:00:56 - load_dim_innchangelog.0 - Invalid state, the Connection object is closed.
2016/09/18 08:00:56 - load_dim_innchangelog.0 - 
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.core.database.Database.rollback(Database.java:867)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.core.database.Database.rollback(Database.java:845)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:332)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.trans.steps.tableoutput.TableOutput.processRow(TableOutput.java:118)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at java.lang.Thread.run(Thread.java:722)
2016/09/18 08:00:56 - load_dim_innchangelog.0 - Caused by: java.sql.SQLException: Invalid state, the Connection object is closed.
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen(ConnectionJDBC2.java:1699)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at net.sourceforge.jtds.jdbc.ConnectionJDBC2.rollback(ConnectionJDBC2.java:2100)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.core.database.Database.rollback(Database.java:858)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     ... 5 more
2016/09/18 08:00:56 - load_dim_innchangelog.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : Unexpected batch update error committing the database connection.
2016/09/18 08:00:56 - load_dim_innchangelog.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseBatchException: 
2016/09/18 08:00:56 - load_dim_innchangelog.0 - Error updating batch
2016/09/18 08:00:56 - load_dim_innchangelog.0 - Invalid state, the Connection object is closed.
2016/09/18 08:00:56 - load_dim_innchangelog.0 - 
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.core.database.Database.createKettleDatabaseBatchException(Database.java:1386)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1378)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:575)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:96)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at java.lang.Thread.run(Thread.java:722)
2016/09/18 08:00:56 - load_dim_innchangelog.0 - Caused by: java.sql.SQLException: Invalid state, the Connection object is closed.
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at net.sourceforge.jtds.jdbc.TdsCore.checkOpen(TdsCore.java:452)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at net.sourceforge.jtds.jdbc.TdsCore.clearResponseQueue(TdsCore.java:727)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at net.sourceforge.jtds.jdbc.JtdsStatement.initialize(JtdsStatement.java:645)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:908)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1362)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     ... 3 more
2016/09/18 08:00:56 - tf_dim_innchangelog - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : 错误被检测到!
2016/09/18 08:00:56 - load_dim_innchangelog.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : Unexpected error rolling back the database connection.
2016/09/18 08:00:56 - load_dim_innchangelog.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseException: 
2016/09/18 08:00:56 - load_dim_innchangelog.0 - Error performing rollback on connection
2016/09/18 08:00:56 - load_dim_innchangelog.0 - Invalid state, the Connection object is closed.
2016/09/18 08:00:56 - load_dim_innchangelog.0 - 
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.core.database.Database.rollback(Database.java:867)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.core.database.Database.rollback(Database.java:845)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:610)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:96)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at java.lang.Thread.run(Thread.java:722)
2016/09/18 08:00:56 - load_dim_innchangelog.0 - Caused by: java.sql.SQLException: Invalid state, the Connection object is closed.
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen(ConnectionJDBC2.java:1699)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at net.sourceforge.jtds.jdbc.ConnectionJDBC2.rollback(ConnectionJDBC2.java:2100)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     at org.pentaho.di.core.database.Database.rollback(Database.java:858)
2016/09/18 08:00:56 - load_dim_innchangelog.0 -     ... 4 more
2016/09/18 08:00:56 - load_dim_innchangelog.0 - 完成处理 (I=0, O=15000, R=18000, W=15000, U=0, E=1
2016/09/18 08:00:56 - Logging - New database connection defined
2016/09/18 08:00:56 - Logging - Attempting to find connection in Named Datasources
2016/09/18 08:00:56 - Logging - Unable to find datasource in Named Datasources. Finally will try to attempt connecting using class 
2016/09/18 08:00:56 - Logging - Connected to database.
2016/09/18 08:00:56 - Logging - Auto commit off
4

2 回答 2

1

这里的实际错误是:

"Unexpected batch update error committing the database connection."

可能是由于其中一个值的数据格式不正确(例如,试图在数字字段中插入太大的数字),......但也可能在我找不到明显原因的情况下发生。

如果您只是想避免该错误,请尝试禁用“表输出”步骤上的“使用批量更新插入”复选框,因为没有它,该步骤可能会开始完美地处理相同的数据。注意:这将是一个性能权衡,所以要小心:)

于 2017-01-30T00:52:51.603 回答
1

这是一个 MSSQL 错误,而不是真正的水壶错误。在不了解您的环境的情况下很难确定,但如果我不得不猜测,我认为您的 MSSQL 配置可能已关闭。也许使用批处理时间太长并且连接本身超时?检查保持活动设置?我很确定您正在将某些东西推到门槛附近,而它正在向您逼近。

祝你好运!

于 2016-09-22T16:02:37.567 回答