Subject Re: Should (Could) FBStatements be held in WeakHashMap
Author Roman Rokytskyy
Nickolay,

> AFAIK, all JDBC APIs are required to be thread-safe by the spec.
> Jaybird breaks the spec here. This is not a big problem, in fact.

No, it's not. You can check the specification. There's nothing about
thread safety. JayBird does not allow multiple threads work on the
same connection (and this is a nature of all JTA-enabled
applications - transaction is associated with a thread, see specs),
but you can happily use connection per thread scheme.

> I created a wrapper around it that is fully thread-safe, does
> correct TPB mapping and detects statement leaks and I distribute it
> to clients that reqire portability between different engines
> (Oracle, MSSQL, Firebird, ...).
> This is just a matter of 300 lines to make Jaybird implementation
> usable in cross-platform environment.

TPB mapping was discussed few times and we still did not agree on it,
so for now JayBird also has correct TPB mapping :). Thread safe pool
and statement leak tracking I will commit to the project after
release. And I agree that this is a matter of few classes (probably
more than 300 lines, but I added some javadoc comments :)).

Best regards,
Roman