Jump to content
We've recently updated our Privacy Statement, available here ×

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


kapil.gureja

Recommended Posts

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?

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...