Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dtp-connect-dev] Reduce the Derby connection reference

Hey Max,

Managed connections must be closed by calling
IConnectionProfile.disconnect().  The life cycle of the managed connection
is managed through IConnectionProfile.connect() and
IConnectionProfile.disconnect().

The embedded Derby connection is a special beast.  There can only ever be a
single connection within a VM, which is why this reference counting method
is employed by the connection factory.  That said, the java.sql.Connection
returned by the IConnection object will be the same for all invocations on
the connection factory for a given embedded Derby connection profile.

If you are getting errors in the DSE because the connection can't be
created, my guess is that a connection to that DB is being created outside
the context of the connection profile's connection factory.  Note, this is
a limitation of the embedded Derby connection profile.

If this is important to you, I would suggest using Derby in a networked
mode.  Derby behaves more like a "normal" DB when running as a networked
DB.  See the following mailing list entry along with the Derby
documentation for instructions on setting this up
(http://dev.eclipse.org/mhonarc/lists/dtp-dev/msg00164.html).  (Note, there
are two different driver definitions for Derby; one for embedded Derby
which is used by the embedded Derby connection profile, and one for
networked Derby which should be used with the generic DB connection
profile.

Please let me know if you need anything else.
Rob



Back to the top