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?
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..
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.