|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Page BUffer
Hi,
Are there any disadvantages in using Page Buffering ??? and i would also like to know what are the main advantages of using Buffers?? tia, gaucho |
|
#2
|
|||
|
|||
|
What exactly do you mean? JSPs are already buffered, all you can do is play with the size of the buffer.
|
|
#3
|
|||
|
|||
|
ok.. heres the situation!
Our JSP application has connections to both Oracle and MySQL... In each page there are nearly a dozen queries executing on a MySQL db. at the begining of each page, a connection is opened and at the end they are close.. Ideally, if the user waits for the page to load completely and then hit the button Next or Cancel, the connection is freed.. But what happens often is that soon after entering the page, many users just click on Next resulting in the connection not getting closed...and soon, the no of connections exceed the allotted number (because they dont get freed automatically) and thus crashes the application.. the scripts are all wrapped with try, catch, finally blocks but to no avail... I want to implement 2 more measures.. 1. set a pageBuffer size such that the pafe is flushed only at the end of generating the entire page.. & 2. use a connection pool for all the databases (another issue where i need u guys help!) thnx, sands |
|
#4
|
|||
|
|||
|
You change the page buffer in a page directive, like
<%@ page buffer="64k" %> The default is 8k. You can also set autoFlush="false", but it will raise an exception if you overflow the buffer before flushing manually. Keep in mind that the jsp1.1 spec says that the buffer has to be flushed before executing a <jsp:include> tag. So if you have any of those, changing the buffer size isn't going to help. Here's an article on connection pooling: http://www.webdevelopersjournal.com...ction_pool.html |
|
#5
|
|||
|
|||
|
hi,
thnx for the link.. hv u implemented it by any chance.. I am facing some trouble with it... had earlier tried using the connection pool configuration provided on the tomcat´s site but that too didnt work out well.. thnx |
|
#6
|
|||
|
|||
|
Haven't worked with connection pools, sorry.
You might look into using tomcat to create the pool, though. I think 4.1 has a nice web interface to allow you to set one up. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Page BUffer |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|