-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rendra,

On 4/8/2010 12:53 PM, Cin Lung wrote:
> Your remark is almost correct. What I did is that I store the result of the
> resultset (which can go up to million lines of rows) in a batch of Java
> beans. Then I set the beans to the HTTP Request and pass them to the
> receiving JSP.

This will kill your server every time. It is a bad plan in general and
will simply not scale in any way. Consider changing... everything.

> But I do remember to return the connection to the pool.

Super!

> I also try to kill
> the statements, result sets, etc by setting them to null.

It's better to call [whatever].close().

> But I realize that
> java might wait for the memory to be cleared by the garbage collector.

If you're storing all that stuff in "beans" in the session, you're toast.

> This goes back to my second problem. If the user closes the browser, the
> request object form the servlet would lost its way to return the result. And
> this will hog the tomcat performance for a while.

If you are sending millions of rows to your client, it's no wonder they
are closing their web browser. :(

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku+VMAACgkQ9CaO5/Lv0PBl2wCfa2YlxlZe6uacPKSc2coaji7Y
bl8AoKguMz08zZNU/plxn8moq5wLLAZt
=wM9J
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to