Large reports timeout

I have a report that can be as long as 500 pages. When it goes into Preview mode for printing, it chugs away, then I get a “Could not retrieve all data needed for printpreview” error.

I get the following error in the servoy server log:

java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:801)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:110)
at com.servoy.j2db.persistence.datasource.i.getConnection(Unknown Source)
at com.servoy.j2db.persistence.Server.getUnmanagedConnection(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine$UpdatePerformer.run(Unknown Source)
at com.servoy.j2db.util.as.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

and

java.util.NoSuchElementException: Timeout waiting for idle object
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:801)
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:110)
at com.servoy.j2db.persistence.datasource.i.getConnection(Unknown Source)
at com.servoy.j2db.persistence.Server.getConnection(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine.a(Unknown Source)
at com.servoy.j2db.dataprocessing.SQLEngine.performQuery(Unknown Source)
at sun.reflect.GeneratedMethodAccessor220.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I upped my active connections on all dbservers to 25, but still no luck. I have resorted to printing 100 records at a time, so the user has to keep hitting the Print button as each group of 100 prints. I tried doing controller.print() instead of printpreview() but same result.

What else might I optimize to correct this situation? What are the reasonable limits for printing large reports, in terms of pages?

I’ve tried loadRecords(query) and loadRecords(dataset), but same result.

Mysql 5.0
Windows 2003 Server
Windows XP for Smart Client
2gb RAM on client machine
Servoy 3.5.7

Increasing DB connections doesn’t help here, you should increase the client memory from the admin pages, restart servoy server, trash the client and download a new one, try setting the client heap size to 256MB, it should be enough. To monitor the client memory usage open the “About Servoy” window, keep it open while running your method to check realtime.

Jason,
really now,
time to switch to Jasper Reports via the Servoy plugin?

Dang, yer right Tom. That’s actually a great suggestion. I have other issues that Jasper might solve too, like poor graphics rendering.

Thanks for the V-8 slap up side the head!

this really seems to be a problem of the connection pool running out of connections.
So if you look when it happens to the admin pages is really the used connections to the max?

How many clients are using connections then? Are you also using db transactions?