TECH TIP: Testing the ReportBuilder Services Auto-restart Feature
If the report server application encounters an unhandled exception then it does the following:
- Writes the error to the log.
- Notifies RB Services that it has encountered a fatal exception.
- Halts execution.
- RB Services then starts a new report server application process.
If you want to test this, try adding some event-handler code to one of your reports. In the Report.BeforePrint event add code to crash the server:
raise Exception.Create('Dummy Exception: Testing RB Services auto-restart');
You can test the above with the RBServer\Demos\Servers\Main project.
- Open the project, compile and run. This will automatically register the application with RB Services.
- Close the application
- Modify one of the form based reports as described above. For my test I modified dm0001.pas.
- Compile the project.
- Use RB Services to run the report server application as a service.
- Use Task Manager to find the RBServer.exe process
- Run the demo client report explorer application and use it to access the server.
- Select and run the report containing the event-handler that raises the exception.
- Use the Task Manager to watch the RBServer.exe process terminate and then restart.
- Select any of the other reports and they should run correctly.