org.pentaho.di.core.exception.KettleDatabaseException: An error occurred executing SQL: SELECT test_id FROM test WHERE test_id % 2 = 0 An I/O error occured while sending to the backend.

Pentaho BI Platform Tracking | Nicolas Wyrwa | 4 years ago
  1. 0

    When "Make the transformation database transactional" aka unique connections is enabled the database connection is closed after the transformation finishes respectively after the next transformation has started. When there are two or more Transformations (that have unique_connections enabled) executed sequentially within a Job this behavior sometimes causes the second transformation to use the same database connection as the previous transformation. In turn this causes the second transformation to fail because its database connection is closed by the first transformation. The Kettle Logs look similar to this: INFO 08-08 11:46:32,708 - Table output - Finished processing (I=0, O=5000, R=5000, W=5000, U=0, E=0) INFO 08-08 11:46:32,711 - concurrency_error - Starting entry [update table] INFO 08-08 11:46:32,711 - update table - Loading transformation from XML file [concurrency_error_update.ktr] INFO 08-08 11:46:32,725 - concurrency_error_update - Dispatching started for transformation [concurrency_error_update] INFO 08-08 11:46:32,735 - concurrency_error_fill - All transaction of database connection 'TestDB' where committed at the end of the transformation. ERROR 08-08 11:46:32,741 - Load odd Ids - Unexpected error ERROR 08-08 11:46:32,741 - Load even Ids - Unexpected error ERROR 08-08 11:46:32,750 - Load even Ids - org.pentaho.di.core.exception.KettleDatabaseException: An error occurred executing SQL: SELECT test_id FROM test WHERE test_id % 2 = 0 An I/O error occured while sending to the backend. at org.pentaho.di.core.database.Database.openQuery(Database.java:1912) at org.pentaho.di.trans.steps.tableinput.TableInput.doQuery(TableInput.java:223) at org.pentaho.di.trans.steps.tableinput.TableInput.processRow(TableInput.java:133) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40) at java.lang.Thread.run(Thread.java:619) Caused by: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:510) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:372) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:252) at org.pentaho.di.core.database.Database.openQuery(Database.java:1898) ... 4 more Caused by: java.io.IOException: Stream closed at sun.nio.cs.StreamEncoder.ensureOpen(StreamEncoder.java:26) at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:121) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212) at org.postgresql.core.PGStream.flush(PGStream.java:522) at org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:1136) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:256) ... 8 more The Database Logs show that both Transformations use the same connection (Same ProcessID) I think that the Problem is that the second transformation doesn't open a new connection at all if the previous transformation hasn't closed its connection yet. Respectively that the first transformation finishes before the connection is closed. A possible Workaround using wait steps is discussed here: http://forums.pentaho.com/showthread.php?85512-Error-comitting-connection-but-only-quot-sometimes-quot

    Pentaho BI Platform Tracking | 4 years ago | Nicolas Wyrwa
    org.pentaho.di.core.exception.KettleDatabaseException: An error occurred executing SQL: SELECT test_id FROM test WHERE test_id % 2 = 0 An I/O error occured while sending to the backend.
  2. 0

    When "Make the transformation database transactional" aka unique connections is enabled the database connection is closed after the transformation finishes respectively after the next transformation has started. When there are two or more Transformations (that have unique_connections enabled) executed sequentially within a Job this behavior sometimes causes the second transformation to use the same database connection as the previous transformation. In turn this causes the second transformation to fail because its database connection is closed by the first transformation. The Kettle Logs look similar to this: INFO 08-08 11:46:32,708 - Table output - Finished processing (I=0, O=5000, R=5000, W=5000, U=0, E=0) INFO 08-08 11:46:32,711 - concurrency_error - Starting entry [update table] INFO 08-08 11:46:32,711 - update table - Loading transformation from XML file [concurrency_error_update.ktr] INFO 08-08 11:46:32,725 - concurrency_error_update - Dispatching started for transformation [concurrency_error_update] INFO 08-08 11:46:32,735 - concurrency_error_fill - All transaction of database connection 'TestDB' where committed at the end of the transformation. ERROR 08-08 11:46:32,741 - Load odd Ids - Unexpected error ERROR 08-08 11:46:32,741 - Load even Ids - Unexpected error ERROR 08-08 11:46:32,750 - Load even Ids - org.pentaho.di.core.exception.KettleDatabaseException: An error occurred executing SQL: SELECT test_id FROM test WHERE test_id % 2 = 0 An I/O error occured while sending to the backend. at org.pentaho.di.core.database.Database.openQuery(Database.java:1912) at org.pentaho.di.trans.steps.tableinput.TableInput.doQuery(TableInput.java:223) at org.pentaho.di.trans.steps.tableinput.TableInput.processRow(TableInput.java:133) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40) at java.lang.Thread.run(Thread.java:619) Caused by: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:510) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:372) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:252) at org.pentaho.di.core.database.Database.openQuery(Database.java:1898) ... 4 more Caused by: java.io.IOException: Stream closed at sun.nio.cs.StreamEncoder.ensureOpen(StreamEncoder.java:26) at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:121) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212) at org.postgresql.core.PGStream.flush(PGStream.java:522) at org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:1136) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:256) ... 8 more The Database Logs show that both Transformations use the same connection (Same ProcessID) I think that the Problem is that the second transformation doesn't open a new connection at all if the previous transformation hasn't closed its connection yet. Respectively that the first transformation finishes before the connection is closed. A possible Workaround using wait steps is discussed here: http://forums.pentaho.com/showthread.php?85512-Error-comitting-connection-but-only-quot-sometimes-quot

    Pentaho BI Platform Tracking | 4 years ago | Nicolas Wyrwa
    org.pentaho.di.core.exception.KettleDatabaseException: An error occurred executing SQL: SELECT test_id FROM test WHERE test_id % 2 = 0 An I/O error occured while sending to the backend.
  3. 0

    PostgreSQL JDBC

    gmane.org | 1 year ago
    org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    PostgreSQL JDBC

    gmane.org | 4 months ago
    org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
  6. 0

    org.postgresql.util.PSQLException: An I/O error occured while sending to the backend

    postgresql.org | 1 year ago
    org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.

  1. linxiaolong 1 times, last 3 days ago
  2. linxiaolong 1 times, last 2 months ago
8 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.IOException

    Stream closed

    at sun.nio.cs.StreamEncoder.ensureOpen()
  2. Java RT
    OutputStreamWriter.flush
    1. sun.nio.cs.StreamEncoder.ensureOpen(StreamEncoder.java:26)
    2. sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:121)
    3. java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
    3 frames
  3. PostgreSQL JDBC Driver
    AbstractJdbc2Statement.executeQuery
    1. org.postgresql.core.PGStream.flush(PGStream.java:522)
    2. org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:1136)
    3. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:256)
    4. org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:510)
    5. org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:372)
    6. org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:252)
    6 frames
  4. org.pentaho.di
    RunThread.run
    1. org.pentaho.di.core.database.Database.openQuery(Database.java:1898)
    2. org.pentaho.di.trans.steps.tableinput.TableInput.doQuery(TableInput.java:223)
    3. org.pentaho.di.trans.steps.tableinput.TableInput.processRow(TableInput.java:133)
    4. org.pentaho.di.trans.step.RunThread.run(RunThread.java:40)
    4 frames
  5. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:619)
    1 frame