https://issues.apache.org/bugzilla/show_bug.cgi?id=53905

Daniel Mikusa <dmik...@vmware.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Daniel Mikusa <dmik...@vmware.com> ---
The behavior you are seeing might be caused because you are storing a reference
to the Connection and Statement objects at the class level on the Servlet
object.  

Only *one* Servlet is used to process all incoming requests, so this isn't
thread safe.  Each request will result in a new Connection being created and it
could possibly overwrite a previous connection before it is closed properly.

...
public class TestServlet extends HttpServlet {

    private DataSource dataSource;
    private Connection connection;
    private Statement statement;

    public void init() throws ServletException {
...

Instead put Connection and Statement inside of "doGet".

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

Reply via email to