@Override public int getCount() { return wrapped.getCount(); }
@Override public ConnectionSource getReadConnectionSource() { ConnectionSource readConnectionSource = wrapped.getReadConnectionSource(); return new SessionBindingConnectionSource(readConnectionSource); }
@Override public ReadPreference getReadPreference() { return wrapped.getReadPreference(); }
private void cleanCursors() { ServerCursorAndNamespace cur; while ((cur = orphanedCursors.poll()) != null) { ReadWriteBinding binding = new SingleServerBinding(delegate.getCluster(), cur.serverCursor.getAddress()); try { ConnectionSource source = binding.getReadConnectionSource(); try { Connection connection = source.getConnection(); try { connection.killCursor(cur.namespace, singletonList(cur.serverCursor.getId())); } finally { connection.release(); } } finally { source.release(); } } finally { binding.release(); } } }
@Override public ConnectionSource getWriteConnectionSource() { ConnectionSource writeConnectionSource = wrapped.getWriteConnectionSource(); return new SessionBindingConnectionSource(writeConnectionSource); }
@Override public ReadWriteBinding retain() { wrapped.retain(); return this; }
@Override public void release() { wrapped.release(); closeSessionIfCountIsZero(); }
@Override public ReadConcern getReadConcern() { if (clientSession.hasActiveTransaction()) { return clientSession.getTransactionOptions().getReadConcern(); } else { return wrapped.getSessionContext().getReadConcern(); } } }
private void cleanCursors() { ServerCursorAndNamespace cur; while ((cur = orphanedCursors.poll()) != null) { ReadWriteBinding binding = new SingleServerBinding(delegate.getCluster(), cur.serverCursor.getAddress()); try { ConnectionSource source = binding.getReadConnectionSource(); try { Connection connection = source.getConnection(); try { connection.killCursor(cur.namespace, singletonList(cur.serverCursor.getId())); } finally { connection.release(); } } finally { source.release(); } } finally { binding.release(); } } }
@Override public ConnectionSource getWriteConnectionSource() { ConnectionSource writeConnectionSource = wrapped.getWriteConnectionSource(); return new SessionBindingConnectionSource(writeConnectionSource); }
@Override public ReadWriteBinding retain() { wrapped.retain(); return this; }
@Override public void release() { wrapped.release(); closeSessionIfCountIsZero(); }
@Override public ReadConcern getReadConcern() { if (clientSession.hasActiveTransaction()) { return clientSession.getTransactionOptions().getReadConcern(); } else { return wrapped.getSessionContext().getReadConcern(); } } }
@Override public ConnectionSource getWriteConnectionSource() { ConnectionSource writeConnectionSource = wrapped.getWriteConnectionSource(); return new SessionBindingConnectionSource(writeConnectionSource); }
@Override public ReadWriteBinding retain() { wrapped.retain(); return this; }
@Override public ConnectionSource getReadConnectionSource() { ConnectionSource readConnectionSource = wrapped.getReadConnectionSource(); return new SessionBindingConnectionSource(readConnectionSource); }
@Override public ReadPreference getReadPreference() { return wrapped.getReadPreference(); }
@Override public int getCount() { return wrapped.getCount(); }
@Override public void release() { wrapped.release(); closeSessionIfCountIsZero(); }
@Override public ReadConcern getReadConcern() { if (clientSession.hasActiveTransaction()) { return clientSession.getTransactionOptions().getReadConcern(); } else { return wrapped.getSessionContext().getReadConcern(); } } }