Hi,

I am checking DbStarter and I love the idea.

The thing which I find surprising is this (line 50,51)


            conn = DriverManager.getConnection(url, user, password);
            servletContext.setAttribute("connection", conn);

This means that when I get a connection from the servletContext, I get
a non-pooled connection, and always the same one is used.

Questions:
- it is safe to access the same connection from multiple threads? How
this works with transactions? what happens if programmers calls
connection.close() after usage (which is the normal case for jdbc
connections) ?
- why not using a servletContext.setAttribute("pool", connectionPool),
which looks more suitable -to me- for a web application?

Am I missing something special that makes this approach valid for H2 ?
(and invalid for all other databases I know of)

Thanks!

L.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to