Edson Alves Pereira wrote:

Hello folks, i�m trying to store a database connection in a session
attribute or request attribute, but i must choose a name that just one
thread per time would knowns. Any idea?


If you put the attribute in your request, the name does not matter: only forwarded or included servlets / JSPs will have access to the object, even if the same name is always used.
If you want each request to use a different instance of an object, request attributes are the correct place. Session attributes are best fitted for instances that must be shared among multiple requests from the same user (well, exactly from the same user session ;-).


Anyway, consider also to execute your DB queries internally and put as attribute the results instead of the connection. It is usually better :-)

        Regards,
        Edson






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



Reply via email to