Share of the connection pool between session-free AppObjects
- Last Updated: August 13, 2021
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
A session-free AppObject is instantiated using an explicitly provided Connection object.
The Connection object instance establishes a reference
to the AppObject's connection pool. If the same Connection object
instance is then used to instantiate other session-free AppObject
instances, the subsequent AppObject instances will share the connection
pool referenced by the Connection object. SubAppObjects
and ProcObjects always share the connection pool of their associated
AppObject.
The Connection object's reference to the connection
pool will be maintained until the releaseConnection() method
is called on the Connection object. This reference
may affect the life cycle of the connection pool. That is, the Connection object
may be used to sustain the existence of the connection pool beyond
the lifetime of the AppObject (and its associated SubAppObjects
and ProcObjects). It is your responsibility to call releaseConnection() on
the Connection object to remove the reference to
the connection pool.
It should be noted that a single Connection
object can be used to instantiate instances of different AppObject classes, provided that the
Connection object refers to an application server that
provides the necessary application services. This is possible since a single application
server can serve multiple application services. However, no validation of this is
provided.
The Connection object does not maintain a reference
to a session-managed AppObject, regardless of how it is constructed.
If a session-managed AppObject is constructed using a Connection object
that contains a reference to a connection pool, an exception is
thrown. In other words, Connection objects cannot
be shared between session-free and session-managed AppObjects.