Gibt es eine Möglichkeit, LdapConnectionPool zusammen mit VirtualListViewControl zu verwenden?Java

Java-Forum
Guest
 Gibt es eine Möglichkeit, LdapConnectionPool zusammen mit VirtualListViewControl zu verwenden?

Post by Guest »

Betrachten wir folgende Aussagen:
  • Wenn ich VirtualListViewControl verwende, muss ich dieselbe LdapConnection verwenden, damit es funktioniert.
  • Wenn ich LdapConnectionPool verwende, kann ich keine bestimmte Verbindung auswählen.
Ich habe die Implementierung von LdapConnectionPool überprüft und festgestellt, dass der Pool die Verbindung bereitstellt an den Kunden, dann tut es der Kunde eine Operation(en) und wenn alles fertig ist, muss der Client Folgendes aufrufen:

Code: Select all

connectionPool.releaseConnection(con)
Bis zu diesem Aufruf wird die Verbindung zu keinem Client zurückgegeben.
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
{
Aber aus bestimmten Gründen gibt LdapConnectionPool die Verbindung erst zurück, wenn sie freigegeben wird.
Meine Frage ist: Was ist die bevorzugte Verwendungsmethode? LdapConnectionPool zusammen mit VirtualListViewControl ?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post