Examples of ISessionPool


Examples of org.geotools.arcsde.session.ISessionPool

        }
        if (ds == null) {
            synchronized (ArcSDEDataStoreFactory.class) {
                // please see WFS for a better example
                if (ds == null) {
                    final ISessionPool sessionPool = getSessionPool();
                    try {
                        ds = connect(sessionPool, monitor);
                    } catch (IOException e) {
                        throw e;
                    }
View Full Code Here

Examples of org.geotools.arcsde.session.ISessionPool

     */
    List<String> getRasterColumns(final String server, final String port, final String instance,
            final String user, final String password, final ISessionPoolFactory sessionFac)
            throws IllegalArgumentException {

        final ISessionPool pool;
        {
            final ArcSDEConnectionConfig connectionConfig;
            Map<String, String> params = new HashMap<String, String>();
            params.put(SERVER_NAME_PARAM_NAME, server);
            params.put(PORT_NUMBER_PARAM_NAME, port);
            params.put(INSTANCE_NAME_PARAM_NAME, instance);
            params.put(USER_NAME_PARAM_NAME, user);
            params.put(PASSWORD_PARAM_NAME, password);
            params.put(MIN_CONNECTIONS_PARAM_NAME, "1");
            params.put(MAX_CONNECTIONS_PARAM_NAME, "1");
            params.put(CONNECTION_TIMEOUT_PARAM_NAME, "1000");
            connectionConfig = ArcSDEConnectionConfig.fromMap(params);
            try {
                pool = sessionFac.createPool(connectionConfig);
            } catch (IOException e) {
                throw new IllegalArgumentException(e.getMessage());
            }
        }

        ISession session;
        try {
            session = pool.getSession();
        } catch (IOException e) {
            throw new IllegalAccessError(e.getMessage());
        } catch (UnavailableConnectionException e) {
            throw new IllegalAccessError(e.getMessage());
        }

        final List<String> rasterTables;
        try {
            rasterTables = session.getRasterColumns();
        } catch (IOException e) {
            throw new IllegalArgumentException(e.getMessage());
        } finally {
            session.dispose();
            pool.close();
        }

        return rasterTables;
    }
View Full Code Here

Examples of org.geotools.arcsde.session.ISessionPool

                "FAKE.TABLE3");

        tableChooserPanel.setSessionFactory(new ISessionPoolFactory() {

            public ISessionPool createPool(final ArcSDEConnectionConfig config) throws IOException {
                return new ISessionPool() {
                    public ISession getSession() throws IOException, UnavailableConnectionException {
                        return getSession(true);
                    }
                    public ISession getSession(final boolean transactional) throws IOException, UnavailableConnectionException {
                        return new SessionWrapper(null) {
View Full Code Here

Examples of org.geotools.arcsde.session.ISessionPool

        super(service);
    }

    @Override
    protected List<IGeoResource> createMembers( IProgressMonitor monitor ) throws IOException {
        ISessionPool pool = getSessionPool();
        ISession session;
        try {
            session = pool.getSession(false);
        } catch (UnavailableConnectionException e) {
            throw (RuntimeException) new RuntimeException().initCause(e);
        }
        List<IGeoResource> members;
        try {
View Full Code Here

Examples of org.geotools.arcsde.session.ISessionPool

            } finally {
                writer.close();
            }
        }

        ISessionPool connectionPool = testData.getConnectionPool();
        ISession session = connectionPool.getSession();
        SeQuery seQuery;
        try {
            int objectId = (int) ArcSDEAdapter.getNumericFid(fid);
            final String whereClause = "ROW_ID=" + objectId;
            seQuery = session.issue(new Command<SeQuery>() {
View Full Code Here

Examples of org.geotools.arcsde.session.ISessionPool

     * creates an ArcSDEDataStore using {@code test-data/testparams.properties} as holder of
     * datastore parameters
     *
     */
    public ArcSDEDataStore getDataStore() throws IOException {
        ISessionPool pool = newSessionPool();
        ArcSDEDataStore dataStore = new ArcSDEDataStore(pool);

        return dataStore;
    }
View Full Code Here

Examples of org.geotools.arcsde.session.ISessionPool

        deleteTable(typeName, true);
    }

    public void deleteTable(final String typeName, final boolean ignoreFailure) throws IOException,
            UnavailableConnectionException {
        ISessionPool connectionPool = getConnectionPool();
        deleteTable(connectionPool, typeName, ignoreFailure);
    }
View Full Code Here

Examples of org.geotools.arcsde.session.ISessionPool

     *            wether to insert some sample rows or not
     * @throws Exception
     *             for any error
     */
    public void createTempTable(final boolean insertTestData) throws Exception {
        ISessionPool connPool = getConnectionPool();

        deleteTempTable(connPool);

        ISession session = connPool.getSession();

        try {
            /*
             * Create a qualified table name with current user's name and the name of the table to
             * be created, "EXAMPLE".
View Full Code Here

Examples of org.geotools.arcsde.session.ISessionPool

     *
     * @throws Exception
     */
    public void insertTestData() throws Exception {
        truncateTempTable();
        ISessionPool connPool = getConnectionPool();
        ISession session = connPool.getSession();
        try {
            SeLayer tempTableLayer = getTempLayer(session);
            insertData(tempTableLayer, session, tempTableColumns);
        } finally {
            session.dispose();
View Full Code Here

Examples of org.geotools.arcsde.session.ISessionPool

        truncateTestTable(tempTableName);
    }

    public void truncateTestTable(final String tempTableName) throws IOException,
            DataSourceException, UnavailableConnectionException {
        final ISessionPool connPool = getConnectionPool();
        final ISession session = connPool.getSession();

        try {
            session.issue(new Command<Void>() {
                @Override
                public Void execute(ISession session, SeConnection connection) throws SeException,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.