- Wenn ich VirtualListViewControl verwende, muss ich dieselbe LdapConnection verwenden, damit es funktioniert.
- Wenn ich LdapConnectionPool verwende, kann ich keine bestimmte Verbindung auswählen.
Code: Select all
connectionPool.releaseConnection(con)
Im Fall von VirtualListViewControl I Es muss eine Zuordnung von Cookie-ID zu LdapConnection vorhanden sein.
Der Client kann einen Bildlauf über einen ziemlich langen Zeitraum durchführen, daher erscheint es überflüssig, die Verbindung für einen so langen Zeitraum zu reservieren.
Auf der Auf der anderen Seite geben wir die Verbindung nach der ersten Anfrage frei, was bedeutet, dass der Benutzer fortfährt Scrolling LDAPConnection könnte gleichzeitig von verschiedenen Threads verwendet werden.
Basierend auf dem Java-Dokument ist es sicher:
Code: Select all
/**
...
* This class is mostly threadsafe. It is possible to process multiple
* concurrent operations over the same connection as long as the methods being
* invoked will not change the state of the connection in a way that might
* impact other operations in progress in unexpected ways. In particular, the
* following should not be attempted while any other operations may be in
* progress on this connection:
* [list]
* [*]
* Using one of the {@code connect} methods to re-establish the connection.
*
* [*]
* Using one of the {@code close} methods to terminate the connection.
*
* [*]
* Using one of the {@code bind} methods to attempt to authenticate the
* connection (unless you are certain that the bind will not impact the
* identity of the associated connection, for example by including the
* retain identity request control in the bind request if using the
* LDAP SDK in conjunction with a Ping Identity, UnboundID, or
* Nokia/Alcatel-Lucent 8661 Directory Server).
*
* [*]
* Attempting to make a change to the way that the underlying communication
* is processed (e.g., by using the StartTLS extended operation to convert
* an insecure connection into a secure one).
*
* [/list]
**/
@ThreadSafety(level=ThreadSafetyLevel.MOSTLY_THREADSAFE)
public final class LDAPConnection
implements FullLDAPInterface, LDAPConnectionInfo, ReferralConnector,
Closeable
{
Meine Frage ist: Was ist die bevorzugte Verwendungsmethode? LdapConnectionPool zusammen mit VirtualListViewControl ?