Malcolm Dew-Jones <[EMAIL PROTECTED]> writes:

> dbh = get_database_connection()
> initialize_some_beans( dbh , other , stuff );
> 
> try 
> {
>   return (mapping.findForward("success"));
> } 
> finally
> {
>   close_connection_no_matter_what();
> }
> 
> Obviously the above does not work.

Perhaps not so obviously, it should work.

> Is there a way for the myAction class to ensure that the database
> connection is closed after the JSP is done, or must the JSP do this?

The JSP should not require the database connection.  The beans you
make available to the view (the JSP) should be simple "value
objects".

You will need the connection to create them, of course, but once
initialize_form_beans completes, you should be able to close your
connection.

-- Jim

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to