本文整理汇总了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();
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
}
示例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;
}
示例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));
}