Subject | Re: Unmanaged scenario |
---|---|
Author | rrokytskyy@yahoo.co.uk |
Post date | 2001-11-12T20:46:43Z |
> (A) via JCAAs far as I remember the code, you can get the FBUnmanagedConnection
>
> (B) with the JDBC 2.0 Optional Package API (DataSource, etc.)
>
> (C) as a plain old non-Optional Package JDBC 2.0 driver.
>
> Note that although the recommendation is to use DataSources, the
> current JDK 1.3 SE documentation still gives examples of the
> DriverManager mode of operation, and that appears to be the way we
> are suppossed to do it with non-J2EE applications. DriverManager
> does not appear to be not deprecated, either, since it's the only
> way to get a Connection with the standard JDBC 2.0 API.
>
> Is it hard to provide the "glue" code to support this API?
via FBDriver right now (old/deprecated way of doing things).
FBUnmanagedConnection supports autocommit. Problem is that
FBStatement ignores this setting. The change to make FBStatement is
very small, I have posted it several times in different lists, but it
was never commited to the CVS.
If one is interested in patching the FBStatement to support
autocommit, here is the code again:
FBStatement.execute(String) (latest CVS source line 396) after the
catch(...) {
...
}
add
finally {
if (c.getAutoCommit())
c.commit();
}
When the statement is instantiated with FBConnection (managed case),
getAutoCommit() is always false, so no autocommit. If statement is
instantiated with FBUnmanagedConnection, getAutoCommit() is true by
default, but setAutoCommit(boolean) works as well.
It would be great to test if it works fine in both cases.
Regards,
Roman