Jasper rendering from java when multiple threads using the same jrxml at the same time

0

We are facing an issue where different sections (the jasper lists designed on the Jasper page) are appearing misordered in the exported PDF, when rendered from JAVA with multiple threads access the same compiled .jasper version with its own separate DB connection. It seems there happening some locking of the jasper objects when accessed by multiple threads simultaneouly. So instead of accessing the same .jasper file, we've made separate JaspeReport objects for each thread so that there doesn't happen any locking and data come back in the correct order. But this change also has not helped out us to resolve the issue.

 

We are not sure how Jasper APIs are designed to work with multiple threads at the same time.

 

Any inputs would be helpful?

kapil.gureja's picture
Joined: Sep 3 2014 - 6:33am
Last seen: 2 years 2 months ago

4 Answers:

0

I'm not getting you. You're suppose to share JasperReport object because it is the same for all instances. Just create new instances of JasperPrint objects for each datasource.

hozawa's picture
49363
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 months 1 week ago
0

We already have separate JasperPrint objects for each thread. Also tried with both - first with same shared JasperReport object and then with separate one JasperReport object per thread. Both ways we are seeing this issue. The issue is not about of getting records/pages from 2 different thread execution messed up with each other. It is happening with in a single JasperPrint page, the data records are now not in the accurate order. As an example, if there are 3 lists designed sequentially on the page - list A, list B, list C. Now for a single case, data should come up in the order - records of List A , followed by records of list B, followed by records of List C, but it is appearing in the order in one of the case - some records of List B, some records of List A, (again) remaining records of List B, so on..

kapil.gureja's picture
Joined: Sep 3 2014 - 6:33am
Last seen: 2 years 2 months ago
0

Suggest you create a new case at Tracker with an example jrxml and detailed steps to reproduce the error. Sorry, but I don't have any problem and I haven't had any problem with multi-threading nor have seen any with JasperReports Server. 

http://community.jaspersoft.com/bug-tracker

hozawa's picture
49363
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 months 1 week ago
0
kapil.gureja's picture
Joined: Sep 3 2014 - 6:33am
Last seen: 2 years 2 months ago
Feedback
randomness