Subject | Re: Connection Pooling in JBird1.5rc3 |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-06-06T13:01:24Z |
> Just a few questions about connection pooling:Yes.
> - What about settings in a connection? If I change autoCommit for
> example, is it reset automatically, when the connection is reused?
> - What are the default setting when a connection is requested theAlways when you get connection from the pool, its value is true.
> first time?
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?there's no example - you just enable it in the pool configuration (see
> - 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.
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, whyEach connection has only one transaction. With one connection you
> should I even use multiple connections?
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 differentAs long as you stay in auto-commit mode - yes.
> statements?
> All together, is there any "best practise for java connectionNot yet, it waits for somebody to write it.
> pooling" document?
Roman