Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Concurrency Issue With POJO oda datasource(I am having an issue when trying to generate pdf's in parallel related to the POJO datasource)
Concurrency Issue With POJO oda datasource [message #1240008] Wed, 05 February 2014 14:14 Go to next message
John Hale is currently offline John HaleFriend
Messages: 1
Registered: February 2014
Junior Member
Hi,

We are using BIRT to generate part of an account statement. Everything works fine as long as I create them one at a time. If I spread it out across multiple threads I get an NPE at Line 84 of org.eclipse.birt.data.oda.pojo.querymodel.MethodSource.

My code is as follows. I don't see anything glaring that I have done wrong based on my previous research. Sharing runnables and engine. Creating new task objects.

Using BIRT runtime 4.3.0

        byte[] retVal = null;
        String reportName = "SomeReport";
        String format = "pdf";
        
        try {
            IReportRunnable runnable = reportCache.getRunnable(REQUEST_RUNNABLE_ATTR);
            
            if (runnable == null) {
                runnable = initializeRunnable(reportCache, reportName);
            }
            
            IRunAndRenderTask runAndRenderTask = getBirtEngine().getReportEngine().createRunAndRenderTask(runnable);

            IRenderOption options = new RenderOption();      
            
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            
            PDFRenderOption pdfOptions = new PDFRenderOption( options );
            pdfOptions.setOutputFormat(format);
            pdfOptions.setOption(IPDFRenderOption.PAGE_OVERFLOW, IPDFRenderOption.OUTPUT_TO_MULTIPLE_PAGES);
            pdfOptions.setOutputStream(baos);
            runAndRenderTask.setRenderOption(pdfOptions);
            
            ArrayList<AccountStatement> statementList = new ArrayList<AccountStatement>();
            statementList.add(accountStatement);
   
            runAndRenderTask.getAppContext().put("APP_CONTEXT_KEY_ACCOUNTSTATEMENTDATASET", statementList);
            runAndRenderTask.getAppContext().put("APP_CONTEXT_KEY_ACCOUNTCHARGELINEITEMSOURCE", createChargeLineItems(context, accountStatement));
            runAndRenderTask.getAppContext().put("APP_CONTEXT_KEY_USEDLOCATIONS", accountStatement.getUsedLocations());
            
            runAndRenderTask.run(); 
            runAndRenderTask.close();       
            
            retVal = baos.toByteArray();
            baos.close();
        } catch (Exception ex) {
            ExceptionUtil.throwRuntimeException("Could not create BIRT Report", ex);
        }
        
        return retVal;


Best Regards,
John
Re: Concurrency Issue With POJO oda datasource [message #1260895 is a reply to message #1240008] Sun, 02 March 2014 01:37 Go to previous message
Christian Piccardi is currently offline Christian PiccardiFriend
Messages: 1
Registered: March 2014
Junior Member
Hi John,

There is a concurrency issue with ClassMethodFieldBuffer. I submitted a bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=429393) and attached a possible fix for 4.3.1

For now you could replace the class in your org.eclipse.birt.runtime.jar with the one attached to the bug. Since it is a signed jar, remember to remove the *.SF and *.RSA files as well or you will run into a security exception.

Christian
Previous Topic:CSS attribute not acting as expected after importing style sheet
Next Topic:BIRT Row
Goto Forum:
  


Current Time: Thu Apr 18 13:04:37 GMT 2024

Powered by FUDForum. Page generated in 0.02597 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top