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

Redesing of configuration and startup aka Hibernate


xmedeko

Recommended Posts

Hello,

JasperReports heavily use ThreadLocal and static HashMaps which may cause memory leaks in the servlet containers. I think the JasperReports configuration and startup should be redesigned and the good examples is a Hibernate project. It uses:

Configuration (immutable, thread safe) -> SessionFactory (thread safe) -> Session (thread unsafe).

So the SessionFactory is created just one per application (stored it the static variable, servlet context or bound to the JNDI.

The JasperReponts could may use

Configuration (immutable, thread safe) -> ReportFactory (thread safe) -> new JasperReport (thread unsafe).

All the resources, which are now cached in the  ThreadLocal or static HashMaps would be cached in the Configuration or ReportFactory.

Also, some utils to bind the ReportFactory to the JNDI would be nice. The JNDI may simplify usage of JasperReports in JEE environment.

Cheers

Andy

 

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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