Bug 545375 - task.setErrorHandlingOption(IEngineTask.CANCEL_ON_ERROR) does not cancel task on JDBC exception
Summary: task.setErrorHandlingOption(IEngineTask.CANCEL_ON_ERROR) does not cancel task...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 4.3.0   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-13 12:56 EDT by Henning von Bargen CLA
Modified: 2019-03-13 12:56 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henning von Bargen CLA 2019-03-13 12:56:47 EDT
I am calling BIRT with task.setErrorHandlingOption(IEngineTask.CANCEL_ON_ERROR).

This seems to work for some cases, but not in the most important case.
If there is a JDBC exception while fetching data from the DB (for example, if a DBA killed your DB session), BIRT tries to continue.

This has several drawbacks.
- First of all, it is absolutely useless. 
- If the report cannot access the database, it's output is crippled.
- The user may not even notice this and think the report output is ok,
  while important data is missing actually.
- This in turn can cause serious real-world trouble.
- It produces a huge bunch of useless log output for all the following attempts to access any data set. For example, one of my production reports produces > 200 KB of log, most lines "Caused by: ..." or "at...".

I propose to add an optional flag to the task, that will cause the task to cancel if an unexpected error happens while accessing the data source.

For an example of what I mean: 
java.sql.SQLRecoverableException: ORA-00028: your session has been killed)

This situation can be provoked by a very slow SQL statement in BIRT and killing the session as a DBA while it is active. More concrete, on Oracle you could call a SQL function that calls SYS.DBMS_LOCK.SLEEP(1) for each row in the SELECT.

As a side note, Javascript exceptions do not seem to cause the task to cancel.
This is arguable (BIRT treats Javascript like a browser, like an optional bonus).
This can be catched after calling the report by considering task.getErrors() afterwards.