Hello people.

I seem to connect and select the data i want from a specific and big table. But when the information to be selected is small, everything is allright. But when i try to select information that is not that much small. For example when i select from 3000 columns, my program gives error.

Web container has been active for 80000 miliseconds.

Also says that there are some number of threads that are hung.

Dani AI

Generated

reported that small result sets return fine but a much larger select causes the web container to hit an active-request timeout and leaves threads marked as hung. and correctly probed for DB product and exception details; those answers point to missing diagnostic data that is needed to be definitive. The observed symptoms most commonly come from either a long-running query on the database side or the application attempting to materialize a very large result set (memory or blocking I/O), not from the JNDI deprecation warning itself.

Practical diagnostic steps:

  • Run the same query directly on the database server (or in a DB client) to confirm execution time and capture an explain/plan and any locks or waits.
  • Capture an application-server thread dump while the request is hung to see whether threads are waiting in JDBC/driver code (IBM has guidance on using thread dumps for hung-thread diagnosis).
  • Enable JDBC/driver logging (or a simple standalone JDBC test) to observe whether the driver is fetching rows incrementally or buffering the full result.
  • Check connection-pool and web-container request-timeout settings; an 80,000 ms active time suggests the request is hitting an app-server timeout rather than a SQL syntax error.

Likely mitigations:

  • Avoid materializing the entire result set in memory. Use server-side cursors / streaming fetch and iterate rows instead of collecting them all.
  • Use pagination or a smaller fetch window rather than a single very large query.
  • Set an appropriate fetch size and a statement query timeout (see the JDBC API), and prefer forward-only, read-only result sets for large scans.
  • Ensure the query is indexed and optimized so the database returns rows quickly instead of scanning the whole table.

The J2CA0294W deprecation message refers to direct JNDI lookup and should be fixed for best practice, but it is unlikely to be causing the hang. Useful diagnostic data to correlate logs: DB vendor/version, JDBC driver version, the stack trace/thread dump showing the hung thread, and the code pattern used to execute/process the ResultSet.

References: JDBC fetch/timeout API (Statement#setFetchSize / setQueryTimeout) and streaming cursors (PostgreSQL JDBC notes). For the JNDI warning see IBM WebSphere documentation.

Recommended Answers

All 3 Replies

Hello people.

I seem to connect and select the data i want from a specific and big table. But when the information to be selected is small, everything is allright. But when i try to select information that is not that much small. For example when i select from 3000 columns, my program gives error.

Web container has been active for 80000 miliseconds.

Also says that there are some number of threads that are hung.

Which database product are you using?

and what kind of exception does your program give?

"J2CA0294W: Deprecated usage of direct JNDI lookup of resource"


But i don'T get any warnings or errors when i choose small numbers.


select * from myTable where (myId between 1 and 100) works

select * from myTable where (myId between 1 and 10000) doesn'T work...

HELP needed. What might the problem be?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.