Есть ли способ использовать LdapConnectionPool вместе с VirtualListViewControl?JAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Есть ли способ использовать LdapConnectionPool вместе с VirtualListViewControl?

Сообщение Anonymous »

Давайте рассмотрим следующие утверждения.
  • Когда я использую VirtualListViewControl, мне приходится использовать тот же LdapConnection, чтобы он работал.
  • Когда я использую LdapConnectionPool, я не могу выбрать конкретное соединение.
Я проверил реализацию LdapConnectionPool и заметил, что пул обеспечивает соединение клиент, затем клиент выполняет операцию(и), и когда все готово, клиент должен позвонить:

Код: Выделить всё

connectionPool.releaseConnection(con)
До этого вызова соединение не будет возвращено ни одному клиенту.
В случае VirtualListViewControl я необходимо иметь карту cookieid для LdapConnection.
Клиент может прокручивать довольно длительный период времени, поэтому резервирование соединения на такое долгое время выглядит избыточным.
На с другой стороны, мы разрываем соединение после первого запроса, что означает, что если пользователь продолжит прокрутку, LDAPConnection может использоваться одновременно разными потоками.
На основании Java-документа это безопасно:

Код: Выделить всё

/**
...
* 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
{
Но по некоторым причинам LdapConnectionPool не будет возвращать соединение, пока оно не будет освобождено.
Поэтому мой вопрос:
Что такое предпочтительный способ использования LdapConnectionPool вместе с VirtualListViewControl ?

Подробнее здесь: https://stackoverflow.com/questions/793 ... iewcontrol
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»