Examples of TableManager


Examples of org.lilyproject.repository.api.TableManager

    @DELETE
    @Path("{name}")
    public Response dropTable(@PathParam("name") String tableName, @Context UriInfo uriInfo) {
        try {
            TableManager tableManager = getRepository(uriInfo).getTableManager();
            if (!tableManager.tableExists(tableName)) {
                throw new ResourceException("Table '" + tableName + "' not found", NOT_FOUND.getStatusCode());
            }
            tableManager.dropTable(tableName);
            return Response.ok().build();
        } catch (IOException ioe) {
            throw new ResourceException("Error dropping table '" + tableName + "'", ioe,
                    INTERNAL_SERVER_ERROR.getStatusCode());
        } catch (InterruptedException ie) {
View Full Code Here

Examples of org.lilyproject.repository.api.TableManager

        this.hbaseConf = hbaseConf;
    }

    @Override
    protected Repository createRepository(RepoTableKey key) throws InterruptedException, RepositoryException {
        TableManager tableManager = new TableManagerImpl(key.getRepositoryName(), hbaseConf, hbaseTableFactory);
        try {
            HTableInterface nonAuthHTable = LilyHBaseSchema.getRecordTable(hbaseTableFactory, key.getRepositoryName(), key.getTableName(), true);
            HTableInterface htable = wrapWithAuthorization(nonAuthHTable);
            return new HBaseRepository(key, this, htable, nonAuthHTable, blobManager, tableManager, getRecordFactory());
        } catch (org.apache.hadoop.hbase.TableNotFoundException e) {
View Full Code Here

Examples of org.ow2.easybeans.tests.common.db.TableManager

        // The reference must be injected by the container using the xml
        // descriptor, so the jdbc_2 must be injected.
        checkResource(sessionContext, ds04, "jdbc/ds04");

        TableManager cTest00 = new TableManager(dsInjection02);
        TableManager cTest01 = new TableManager(ds05);
        try {
            // It must create twice the table, because each is in a different
            // database.
            cTest00.insertTable("ds04");
            cTest01.insertTable("ds04");

            cTest00.deleteTable("ds04");
            cTest01.deleteTable("ds04");
        } catch (Exception e) {
            throw new IllegalStateException("Exception: " + e.getMessage());
        }
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.db.TableManager

     * @throws SQLException if a databse error occurs.
     * @throws NamingException if a lookup error occurs.
     */
    @TransactionAttribute(value = TransactionAttributeType.REQUIRED)
    public void insertTableWithRequired(final String dbName) throws SQLException, NamingException {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(TABLE);
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.db.TableManager

     * @throws SQLException if a databse error occurs.
     * @throws NamingException if a lookup error occurs.
     */
    @TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
    public void insertTableWithNotSupported(final String dbName) throws SQLException, NamingException {
        TableManager tableManager = new TableManager(dbName);
        tableManager.insertTable(TABLE);
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.db.TableManager

     * Tests a resource access.
     * @throws Exception if a problem occurs.
     */
    protected void access00() throws Exception{
        //Resource Test
        TableManager cTest = new TableManager(ds);
        cTest.test("ResourceTester");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.db.TableManager

            HeuristicMixedException, TransactionException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        utx.begin();
        try {
            if (!callOnlyTransaction) {
                TableManager tableManager = new TableManager(dbName);
                tableManager.deleteTable(TABLE);
            }
            utx.commit();
        } catch (Exception e) {
            utx.rollback();
            throw new TransactionException("Error during commit.", e);
View Full Code Here

Examples of org.ow2.easybeans.tests.common.db.TableManager

    public void deleteTableWithoutBegin(final boolean callOnlyTransaction, final String dbName) throws SQLException,
            NamingException, SystemException, NotSupportedException, HeuristicRollbackException, RollbackException,
            HeuristicMixedException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        if (!callOnlyTransaction) {
            TableManager tableManager = new TableManager(dbName);
            tableManager.deleteTable(TABLE);
        }
        utx.commit();

    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.db.TableManager

            HeuristicMixedException, TransactionException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        utx.begin();
        try {
            if (!callOnlyTransaction) {
                TableManager tableManager = new TableManager(dbName);
                tableManager.insertTable(TABLE);
            }
            utx.commit();
        } catch (Exception e) {
            utx.rollback();
            throw new TransactionException("Error during commit.", e);
View Full Code Here

Examples of org.ow2.easybeans.tests.common.db.TableManager

    public void insertTableWithoutCommit(final boolean callOnlyTransaction, final String dbName) throws SQLException,
            NamingException, SystemException, NotSupportedException {
        UserTransaction utx = TransactionHelper.getUserTransaction();
        utx.begin();
        if (!callOnlyTransaction) {
            TableManager tableManager = new TableManager(dbName);
            tableManager.insertTable(TABLE);
        }
    }
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.