当前位置: 首页>>代码示例>>Java>>正文


Java OObjectDatabaseTx.close方法代码示例

本文整理汇总了Java中com.orientechnologies.orient.object.db.OObjectDatabaseTx.close方法的典型用法代码示例。如果您正苦于以下问题:Java OObjectDatabaseTx.close方法的具体用法?Java OObjectDatabaseTx.close怎么用?Java OObjectDatabaseTx.close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.orientechnologies.orient.object.db.OObjectDatabaseTx的用法示例。


在下文中一共展示了OObjectDatabaseTx.close方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initObjectDatabaseSchema

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
private void initObjectDatabaseSchema()
{
    objectDatabaseTx = new OObjectDatabaseTx(getPartitionedDatabasePool().acquire());
    //        if (objectDatabaseTx.exists())
    //        {
    //            objectDatabaseTx.open("admin", "admin");
    //        }
    //        else
    //        {
    //            objectDatabaseTx.create();
    //        }

    objectDatabaseTx.setAutomaticSchemaGeneration(true);

    objectDatabaseTx.getEntityManager().registerEntityClasses(Transaction.class.getPackage().getName(), RepositorySource.class.getClassLoader());

    objectDatabaseTx.getMetadata().getSchema().synchronizeSchema();

    objectDatabaseTx.close();
}
 
开发者ID:geekflow,项目名称:light,代码行数:21,代码来源:RepositorySource.java

示例2: initTableClass

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
private void initTableClass()
{
    OObjectDatabaseTx objectDatabaseTx = getObjectDatabaseTx();

    OClass oClass = objectDatabaseTx.getMetadata().getSchema().getClass(Transaction.class);

    if (oClass != null && !oClass.areIndexed("tid"))
    {
        oClass.createIndex("TransactionIdUnique", OClass.INDEX_TYPE.UNIQUE, "tid");
    }

    oClass = objectDatabaseTx.getMetadata().getSchema().getClass(ProfileData.class);

    if (oClass != null && !oClass.areIndexed("tid", "sequence"))
    {
        oClass.createIndex("TransactionIdSequenceUnique", OClass.INDEX_TYPE.UNIQUE, "tid", "sequence");
    }

    objectDatabaseTx.close();
}
 
开发者ID:geekflow,项目名称:light,代码行数:21,代码来源:RepositorySource.java

示例3: save

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
public <RET> RET save(final Object iContent)
{
    final OObjectDatabaseTx databaseTx = repositorySource.getObjectDatabaseTx();

    try
    {
        return (RET) databaseTx.save(iContent);
    }
    finally
    {
        databaseTx.close();
    }
}
 
开发者ID:geekflow,项目名称:light,代码行数:14,代码来源:RepositoryExecutor.java

示例4: command

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
public <RET extends OCommandRequest> RET command(final OCommandRequest iCommand)
{
    final OObjectDatabaseTx databaseTx = repositorySource.getObjectDatabaseTx();

    try
    {
        return (RET) databaseTx.command(iCommand);
    }
    finally
    {
        databaseTx.close();
    }
}
 
开发者ID:geekflow,项目名称:light,代码行数:14,代码来源:RepositoryExecutor.java

示例5: execute

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
public <RET extends List<?>> RET execute(final OCommandRequest iCommand, Object... iArgs)
{
    final OObjectDatabaseTx databaseTx = repositorySource.getObjectDatabaseTx();

    List<Transaction> list = databaseTx.command(iCommand).execute(iArgs);

    try
    {
        return (RET) detach(databaseTx, list);
    }
    finally
    {
        databaseTx.close();
    }
}
 
开发者ID:geekflow,项目名称:light,代码行数:16,代码来源:RepositoryExecutor.java

示例6: query

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
public <RET extends List<?>> RET query(OQuery<?> iCommand, Object... iArgs)
{
    final OObjectDatabaseTx databaseTx = repositorySource.getObjectDatabaseTx();

    List<Transaction> list = databaseTx.query(iCommand, iArgs);

    try
    {
        return (RET) detach(databaseTx, list);
    }
    finally
    {
        databaseTx.close();
    }
}
 
开发者ID:geekflow,项目名称:light,代码行数:16,代码来源:RepositoryExecutor.java

示例7: testSave

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
@Test
public void testSave()
{
    OObjectDatabaseTx objectDatabaseTx = repositorySource.getObjectDatabaseTx();

    Transaction transaction = objectDatabaseTx.newInstance(Transaction.class, IdentifierUtils.nextLong());

    transactionDao.save(transaction);

    objectDatabaseTx.close();
}
 
开发者ID:geekflow,项目名称:light,代码行数:12,代码来源:TransactionDaoTest.java

示例8: doFilter

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException
{

    OObjectDatabaseTx db = orientDBFactory.newInstance();
    OrientDBUtil.setDatabase(db);
    try
    {
        filterChain.doFilter(servletRequest, servletResponse);
    } finally
    {
        db.close();
    }
}
 
开发者ID:jesty,项目名称:orientdb-javaee,代码行数:14,代码来源:OrientDBFilter.java

示例9: modify

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
@Override
public Transaction modify(Transaction transaction)
{
    OObjectDatabaseTx databaseTx = repositorySource.getObjectDatabaseTx();

    try
    {
        databaseTx.begin();

        //            List<ODocument> result = documentTx.query(new OSQLSynchQuery<ODocument>("SELECT * FROM transaction WHERE id = " + transaction.getId() + ""));
        List<ODocument> result = databaseTx.query(new OSQLSynchQuery<ODocument>("SELECT * FROM transaction"));


        //                int recordsUpdated = documentTx.command(new OCommandSQL("UPDATE Classes SET byteCode = " + classes.getByteCodes() + " WHERE name = " + classes.getName())).execute();

        //                for (ODocument document : documentTx.browseClass("transaction"))
        //                {
        //                    document.field("id", transaction.getId());
        //                    document.field("oid", transaction.getOid());
        //                    document.field("guid", transaction.getGuid());
        //                    document.field("endTime", transaction.getEndTime());
        //                    document.field("elapsedTime", transaction.getElapsedTime());
        //                    document.field("cpuTime", transaction.getCpuTime());
        //                    document.field("sqlCount", transaction.getSqlCount());
        //                    document.field("sqlTime", transaction.getSqlTime());
        //                    document.field("fetchCount", transaction.getFetchCount());
        //                    document.field("fetchTime", transaction.getFetchTime());
        //                    document.field("ipAddress", transaction.getIpAddress());
        //                    document.field("transactionHash", transaction.getTransactionHash());
        //                    document.field("browserHash", transaction.getBrowserHash());
        //                    document.field("userHash", transaction.getUserHash());
        //                    document.save();
        //                }
        //                documentTx.getMetadata().getSchema().reload();

        databaseTx.commit();
    }
    catch (Exception exception)
    {
        databaseTx.rollback();
    }
    finally
    {
        databaseTx.close();
    }

    return transaction;
}
 
开发者ID:geekflow,项目名称:light,代码行数:49,代码来源:TransactionDaoImpl.java

示例10: testStartup

import com.orientechnologies.orient.object.db.OObjectDatabaseTx; //导入方法依赖的package包/类
@Test
    public void testStartup()
    {
//        server.startup(REPOSITORY_CONFIG);

//        assertThat(server.isActive(), is(true));

        TestConfigure.load();

        RepositorySource repositorySource = TestConfigure.getRepositorySource();

        TransactionDao transactionDao = new TransactionDaoImpl(TestConfigure.getRepositoryExecutor());
        OPartitionedDatabasePool partitionedDatabasePool = repositorySource.getPartitionedDatabasePool();

        assertThat(partitionedDatabasePool.getAvailableConnections(), is(partitionedDatabasePool.getCreatedInstances()));

        OObjectDatabaseTx objectDatabaseTx = repositorySource.getObjectDatabaseTx();

        Transaction transaction = objectDatabaseTx.newInstance(Transaction.class, IdentifierUtils.nextLong());

        objectDatabaseTx.close();

        transactionDao.save(transaction);

        assertThat(partitionedDatabasePool.getAvailableConnections(), is(partitionedDatabasePool.getCreatedInstances()));

//        assertThat(server.shutdown(), is(true));
    }
 
开发者ID:geekflow,项目名称:light,代码行数:29,代码来源:OrientDBEmbedServerTest.java


注:本文中的com.orientechnologies.orient.object.db.OObjectDatabaseTx.close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。