Subject Re: Connection Pooling in JBird1.5rc3
Author Roman Rokytskyy
> Just a few questions about connection pooling:
> - What about settings in a connection? If I change autoCommit for
> example, is it reset automatically, when the connection is reused?

Yes.

> - What are the default setting when a connection is requested the
> first time?

Always when you get connection from the pool, its value is true.
Similar to the situation with DriverManager - any new connection has
auto-commit enabled.

> - May I even change settings?

In non-managed environment - yes, with external transaction manager - no.

> - How to do batch processing?

use Statement.addBatch(String) and PreparedStatement.addBatch() methods.

> What about the new Statement Pooling feature?
> - The faq contain an example, how to use the connection without it,
> and it tells me, that statement pooling is a good thing, but an
> example is missing.

there's no example - you just enable it in the pool configuration (see
statementPooling and maxStatements properties).

> - Where can I find such an example?

Does not exist - feature is transparent, no additional steps are required.

> - Do these statements autocommit?

Depends on what's the state of auto-commit of the connection that
created that statement.

> - If connections are now safe to be used in multiple threads, why
> should I even use multiple connections?

Each connection has only one transaction. With one connection you
cannot execute two transaction simultanously. Also you cannot log in
using different users with one connection.

> - Wouldn't it suffice to share one connection and use only different
> statements?

As long as you stay in auto-commit mode - yes.

> All together, is there any "best practise for java connection
> pooling" document?

Not yet, it waits for somebody to write it.

Roman